Static libraries crash Mixmod 2.1.1 install on Fedora 11+

5 views
Skip to first unread message

Olivier

unread,
Apr 6, 2010, 4:32:25 AM4/6/10
to mixmod
A typical install of Mixmod 2.1.1 from source on Fedora11+ (x64 and
i86) will crash during 'make' with:

[ 97%] Built target newmatlib
Linking CXX executable mixmod
/usr/bin/ld: cannot find -lm
collect2: ld returned 1 exit status
make[2]: *** [SRC/mixmod] Error 1
make[1]: *** [SRC/CMakeFiles/mixmod.dir/all] Error 2
make: *** [all] Error 2


This is due to the '-static' option passed to the linker. Indeed,
Mixmod 2.1.1 uses static libraries.

Swaping to dynamic library is fine and can be done easily by changing
the ./SRC/CMakeLists.txt file as follows:

##############################################"
--- SRC/CMakeLists.txt 2010-04-06 08:55:40.063337623 +0200
+++ SRC/CMakeLists-patch.txt 2010-04-06 08:56:19.577538936 +0200
@@ -4,13 +4,13 @@
ADD_EXECUTABLE(mixmod ${mixmod_src})


-TARGET_LINK_LIBRARIES(mixmod -static mixmodlib newmatlib)
+TARGET_LINK_LIBRARIES(mixmod mixmodlib newmatlib)

SET(test_src XEMTest.cpp)

ADD_EXECUTABLE(test ${test_src})

-TARGET_LINK_LIBRARIES(test -static mixmodlib newmatlib)
+TARGET_LINK_LIBRARIES(test mixmodlib newmatlib)

INSTALL(TARGETS mixmod test DESTINATION "BIN")
##############################################"

Reply all
Reply to author
Forward
0 new messages