The LAPACK forum has moved to https://github.com/Reference-LAPACK/lapack/discussions.

clapack shared dynamic library through cmake

Open discussion regarding features, bugs, issues, vendors, etc.

clapack shared dynamic library through cmake

Postby georgiuk » Sat Jan 30, 2010 12:40 pm

So I would like to build a shared library of clapack through cmake. What is the prcedure?

When I put SET(BUILD_SHARED_LIBS ON) to CMakeLists.txt i run cmake . and then make, I get an error
.....
[ 5%] Building C object F2CLIBS/libf2c/CMakeFiles/f2c.dir/etime_.c.o
Linking C shared library libf2c.dylib
Undefined symbols:
"_MAIN__", referenced from:
_main in main.c.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[2]: *** [F2CLIBS/libf2c/libf2c.dylib] Error 1
make[1]: *** [F2CLIBS/libf2c/CMakeFiles/f2c.dir/all] Error 2
make: *** [all] Error 2

I run it on osx snow leopard and I have installed gfortran and f2c from http://www.webmo.net/support/fortran_osx.html

Any ideas?

Best Regards,
Kostas
georgiuk
 
Posts: 2
Joined: Sat Jan 30, 2010 12:29 pm

Re: clapack shared dynamic library through cmake

Postby georgiuk » Sun Jan 31, 2010 12:22 pm

i found a sort of solution for mac osx
adding this to CMakeLists.txt
IF(APPLE)
set(CMAKE_SHARED_LINKER_FLAGS "-undefined dynamic_lookup")
ENDIF(APPLE)

I don't know if it is ok or not

What do you think?

Also if somehow setting a command line option with -DVARIABLE:TYPE=VALUE could set the
SET(BUILD_SHARED_LIBS ON)
and then some if-else checking this variable and customizing depending on platform (as above)
georgiuk
 
Posts: 2
Joined: Sat Jan 30, 2010 12:29 pm

Re: clapack shared dynamic library through cmake

Postby ChimpGames » Mon Aug 16, 2010 7:55 pm

georgiuk,

Looking over this code, that should work. Have you tried it out and if so, what results did you get back?
There is a cli option with the DVARIABLE:TYPE=VALUE but i don't have the syntax off hand.

Reguards
ChimpGames
 
Posts: 1
Joined: Mon Aug 16, 2010 7:52 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 4 guests