LEVMAR compilation problem with LAPACK

Post here if you have a question about the installation process

LEVMAR compilation problem with LAPACK

Postby aachen_24 » Wed Nov 16, 2011 12:02 pm

Hi all,

I am trying since 2 days to compile levmar.lib with lapack but I get some errors. (Without lapack it works)

Here is how I am compiling:

1) I downloaed the prebuilt binaries for Windows 32 from this link: http://www.netlib.org/clapack/LIB_WINDO ... ndows.html and copied them to C:\src\lib folder

2) Then I untar the levmar-2.5.tgz and made C:\levmar-2.5 folder

3) Here is how my levmar Makefile.vc looks like :

# Under Unix/Linux, use Makefile for GCC
#
# At the command prompt, type
# nmake /f Makefile.vc
#
# NOTE: To use this, you must have MSVC installed and properly
# configured for command line use (you might need to run VCVARS32.BAT
# included with your copy of MSVC). Another option is to use the
# free MSVC toolkit from http://msdn.microsoft.com/visualc/vctoolkit2003/
#

MAKE=nmake /nologo
CC=cl /nologo
CONFIGFLAGS=#/ULINSOLVERS_RETAIN_MEMORY
# YOU MIGHT WANT TO UNCOMMENT THE FOLLOWING LINE
#SPOPTFLAGS=/GL /G7 /arch:SSE2 # special optimization: resp. whole program opt., Athlon/Pentium4 opt., SSE2 extensions
# /MD COMPILES WITH MULTIPLE THREADS SUPPORT. TO DISABLE IT, SUBSTITUTE WITH /ML
# FLAG /EHsc SUPERSEDED /GX IN MSVC'05. IF YOU HAVE AN EARLIER VERSION THAT COMPLAINS ABOUT IT, CHANGE /EHsc TO /GX
CFLAGS=$(CONFIGFLAGS) /I. /MD /W3 /EHsc /O2 $(SPOPTFLAGS) # /Wall
LAPACKLIBS_PATH=C:\src\lib # WHEN USING LAPACK, CHANGE THIS TO WHERE YOUR COMPILED LIBS ARE!
LDFLAGS=/link /subsystem:console /opt:ref /libpath:$(LAPACKLIBS_PATH) /libpath:.
LIBOBJS=lm.obj Axb.obj misc.obj lmlec.obj lmbc.obj lmblec.obj lmbleic.obj
LIBSRCS=lm.c Axb.c misc.c lmlec.c lmbc.c lmblec.c lmbleic.c
DEMOBJS=lmdemo.obj
DEMOSRCS=lmdemo.c
AR=lib /nologo

# comment the following line if you are not using LAPACK
LAPACKLIBS=clapack.lib blas.lib libF77.lib libI77.lib

LIBS=levmar.lib $(LAPACKLIBS)

all: levmar.lib lmdemo.exe

levmar.lib: $(LIBOBJS)
$(AR) /out:levmar.lib $(LIBOBJS)

lmdemo.exe: $(DEMOBJS) levmar.lib
$(CC) $(DEMOBJS) $(LDFLAGS) /out:lmdemo.exe $(LIBS)

lm.obj: lm.c lm_core.c levmar.h misc.h compiler.h
Axb.obj: Axb.c Axb_core.c levmar.h misc.h
misc.obj: misc.c misc_core.c levmar.h misc.h
lmlec.obj: lmlec.c lmlec_core.c levmar.h misc.h
lmbc.obj: lmbc.c lmbc_core.c levmar.h misc.h compiler.h
lmblec.obj: lmblec.c lmblec_core.c levmar.h misc.h
lmbleic.obj: lmbleic.c lmbleic_core.c levmar.h misc.h

lmdemo.obj: levmar.h

clean:
-del $(LIBOBJS) $(DEMOBJS)

cleanall: clean
-del lmdemo.exe
-del levmar.lib

4) Next, I opened Visual studio 2008 command line prompt and cd to C:\levmar-2.5 folder and typed 'nmake /f Makefile.vc' and got following errors:

C:\levmar-2.5>nmake /f Makefile.vc

Microsoft (R) Program Maintenance Utility Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

cl /nologo /I. /MD /W3 /EHsc /O2 /c lm.c Axb.c misc.c lmlec.c lmbc.c l
mblec.c lmbleic.c
lm.c
Axb.c
misc.c
lmlec.c
lmbc.c
lmblec.c
lmbleic.c
Generating Code...
lib /nologo /out:levmar.lib lm.obj Axb.obj misc.obj lmlec.obj lmbc.obj l
mblec.obj lmbleic.obj
cl /nologo /I. /MD /W3 /EHsc /O2 /c lmdemo.c
lmdemo.c
cl /nologo lmdemo.obj /link /subsystem:console /opt:ref /libpath:C:\src\
lib /libpath:. /out:lmdemo.exe levmar.lib clapack.lib blas.lib libF77.lib libI77
.lib
LINK : fatal error LNK1181: cannot open input file 'libF77.lib'
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN
\cl.EXE"' : return code '0x2'
Stop.

**************************************************************************************************
It complains that it can't find libF77.lib but I don't understand how to compile libF77.lib and libI77 ?
I din't find any documentation about it .

Is my Makefile.vc correct ?

Please help me. I am completely new to this and have no clue.
Thanks,
Aachen
aachen_24
 
Posts: 1
Joined: Wed Nov 16, 2011 11:48 am

Re: LEVMAR compilation problem with LAPACK

Postby admin » Wed Nov 23, 2011 1:45 pm

Please refer to http://icl.cs.utk.edu/lapack-for-window ... index.html
You can use the MinGW library directly without the need of a FORTRAN compiler, but still call LAPACK directly.
LAPACKE is preferred than CLAPACK. WE are working on porting LAPACKE to CMAKE so you can generate the library and call it directly from your C program.
Julie
admin
Site Admin
 
Posts: 468
Joined: Wed Dec 08, 2004 7:07 pm


Return to Installation

Who is online

Users browsing this forum: No registered users and 1 guest