Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmake error #5

Open
rheiland opened this issue Oct 10, 2018 · 21 comments
Open

cmake error #5

rheiland opened this issue Oct 10, 2018 · 21 comments
Assignees

Comments

@rheiland
Copy link
Collaborator

~/git/sbmlsolver$ export SBMLSOLVER_DEP_DIR=/Users/heiland/dev/sbmlsolver_install
~/git/sbmlsolver$ mkdir build
~/git/sbmlsolver$ cd build

~/git/sbmlsolver/build$ cmake ..
-- The C compiler identification is AppleClang 9.0.0.9000039
-- The CXX compiler identification is AppleClang 9.0.0.9000039
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:29 (if):
if given arguments:

"IS_DIRECTORY" "AND" "IS_DIRECTORY" "/include/rr-libstruct"

Unknown arguments specified

@AndySomogyi
Copy link
Owner

SBMLSOLVER_DEP_DIR is NOT an environment variable, its a cmake variable. You have to run ccmake to configure and generate the project.

ccmake is where you can choose all of the configure options.

Run cmake -G "Eclipse CDT4 - Unix Makefiles" to generate project file for eclipse, ccmake -G Xcode to generate Xcode project files, ccmake Visual Studio 15 2017 Win64 for a visual studio project file. If you're using CLion, that uses the CMake project directly, and has a built in configurator in place of ccmake.

I STRONGLY recommend using the cmake GUI to configure the project, because it has a built-in file browser where you can choose locations.

AndySomogyi added a commit that referenced this issue Oct 10, 2018
@rheiland
Copy link
Collaborator Author

rheiland commented Oct 11, 2018

Using Andy's latest lib, we can successfully compile/link/run on OSX (10.12.6), so long as we set the path to the lib in DYLD_LIBRARY_PATH:
...SBMLsolver/binaries/alpha_0.0002/lib$ g++-8 test_mx.cpp -I../include -L. -lsbmlsolver
...SBMLsolver/binaries/alpha_0.0002/lib$ a.out
dyld: Library not loaded: /Users/andy/src/sbmlsolver_build/lib/libsbmlsolver.dylib

...SBMLsolver/binaries/alpha_0.0002/lib$ otool -L libsbmlsolver.dylib
libsbmlsolver.dylib:
/Users/andy/src/sbmlsolver_build/lib/libsbmlsolver.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libxml2.2.dylib (compatibility version 10.0.0, current version 10.9.0)
/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
/usr/lib/libform.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.50.4)

$ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:SBMLsolver/binaries/alpha_0.0002/lib
...SBMLsolver/binaries/alpha_0.0002/lib$ a.out
we’re good, made a solver, ready to use itready to use the scalar system, connect it to our compartment

@MathCancer
Copy link
Collaborator

MathCancer commented Oct 11, 2018 via email

@rheiland
Copy link
Collaborator Author

rheiland commented Oct 11, 2018 via email

@MathCancer
Copy link
Collaborator

MathCancer commented Oct 11, 2018 via email

@AndySomogyi
Copy link
Owner

There was a time when Mac OS used to be the best of three, but that time has come and gone.

From a dev environment, there’s simply no question than MS Visual Studio is the best one ever written.

From an operating system perspective (kernel design, consistency of API), Windows again wins.

Quality of desktop apps, well, they’re all going downhill (though with Linux, it started at rock bottom, and never left, so I guess it can’t go downhill anymore)

Windows has made great strides in usability, and macOS has continued to go downhill since Steve Jobs death.

@rheiland
Copy link
Collaborator Author

After building the llvm and sbmlsolver_dep stuff, I try to build sbmlsolver:

heiland@ubu18:~/git/sbmlsolver/build$ cmake -DSBMLSOLVER_DEP_DIR=/home/heiland/local ..
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
is dir: /home/heiland/local
-- Looking for LLVM installed without CMake
-- Could NOT find LLVM executable
CMake Error at CMakeLists.txt:97 (message):
BUILD_LLVM is enabled, but no LLVM installation was found

-- Configuring incomplete, errors occurred!

@AndySomogyi
Copy link
Owner

Please see previous comments. SBMLSOLVER_DEP_DIR is NOT an environment variable, it is a cmake variable, and has to be set with the configure cmake programccmake. I STRONGLY recommend running the GUI version, cmake-gui to configure the project, and to generate project files.

The cmake-gui will give you a file browser of where to choose folders and so forth.

Here, you can also choose what project file to generate for your IDE of choice, be it Visual Studio on Windows, Eclipse, or Xcode, or even KDevelop.

It should look like this when you configure it:

@rheiland
Copy link
Collaborator Author

I know it's not an env var. Using "-D" is how you set cmake vars. I spent a few years using cmake regularly. I never liked nor used the gui version, nor should it be necessary. Everything's doable from the CLI. Nor do I plan to use any framework for cmake. Sorry. Do you know why, exactly, it reports "no LLVM installation was found" ?

@AndySomogyi
Copy link
Owner

It should have picked it up from the SBMLSOLVER_DEP var, I'll take a look at why it's not picking it up.

You need to set the LLVM_CONFIG_EXECUTABLE var like this. cmake is where you can choose different config options.

cmake

@rheiland
Copy link
Collaborator Author

Providing the llvm-config gets me farther, but still errors (next). Perhaps if you post your entire CMakeCache.txt, it may shed some light?

heiland@ubu18:~/git/sbmlsolver/build$ cmake -DSBMLSOLVER_DEP_DIR=/home/heiland/local -DLLVM_CONFIG_EXECUTABLE=/home/heiland/local/llvm-config ..

-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
is dir: /home/heiland/local
-- Looking for LLVM installed without CMake
-- LLVM llvm-config found at: /home/heiland/local/llvm-config
-- LLVM_VERSION_MAJOR:
-- LLVM_VERSION_MINOR:
-- LLVM_VERSION_PATCH:
-- LLVM_BIN_DIR:
-- LLVM_LIB_DIR:
-- LLVM_INCLUDE_DIRS:
-- LLVM_LIBRARY_DIRS:
CMake Error at cmake/FindLLVM.cmake:113 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:114 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:116 (STRING):
STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:117 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:118 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:121 (string):
string sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:124 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:125 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:132 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:133 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:134 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:135 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:136 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:137 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:138 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:139 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

CMake Error at cmake/FindLLVM.cmake:140 (STRING):
STRING sub-command REPLACE requires at least four arguments.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

-- LLVM_DEFINITIONS:
CMake Error at cmake/FindLLVM.cmake:155 (STRING):
STRING sub-command REGEX, mode REPLACE needs at least 6 arguments total to
command.
Call Stack (most recent call first):
CMakeLists.txt:69 (find_package)

-- LLVM_LIBRARIES:
CMake Error at CMakeLists.txt:97 (message):
BUILD_LLVM is enabled, but no LLVM installation was found

-- Configuring incomplete, errors occurred!
See also "/home/heiland/git/sbmlsolver/build/CMakeFiles/CMakeOutput.log".

@AndySomogyi
Copy link
Owner

You need to run ccmake to configure it. That's the way the build is set up, thats ccmake with two cs. I've never tried to build it without running the configure step first to set things up.

Your dep install path bin, i.e. /Users/andy/local/bin/ should be in your PATH environment var I think, as the llvm-config program might call some others, but not sure.

CMakeCache.txt

@AndySomogyi
Copy link
Owner

Also, when you ran the sbmlsolver dep build, did you run the make install also? It's strange that your sbmlsolver_dep install dir does not have a bin subdir.

@AndySomogyi
Copy link
Owner

Also, you should be able to execute the llvm-config, by the looks of your output, it could not execute it, or it produced no output, it should run like this:

Argo:~ andy$ /Users/andy/local/bin/llvm-config
usage: llvm-config <OPTION>... [<COMPONENT>...]

Get various configuration information needed to compile programs which use
LLVM.  Typically called from 'configure' scripts.  Examples:
  llvm-config --cxxflags
  llvm-config --ldflags
  llvm-config --libs engine bcreader scalaropts

Options:
  --version         Print LLVM version.
  --prefix          Print the installation prefix.
  --src-root        Print the source root LLVM was built from.
  --obj-root        Print the object root used to build LLVM.
  --bindir          Directory containing LLVM executables.
  --includedir      Directory containing LLVM headers.
  --libdir          Directory containing LLVM libraries.
  --cppflags        C preprocessor flags for files that include LLVM headers.
  --cflags          C compiler flags for files that include LLVM headers.
  --cxxflags        C++ compiler flags for files that include LLVM headers.
  --ldflags         Print Linker flags.
  --system-libs     System Libraries needed to link against LLVM components.
  --libs            Libraries needed to link against LLVM components.
  --libnames        Bare library names for in-tree builds.
  --libfiles        Fully qualified library filenames for makefile depends.
  --components      List of all possible components.
  --targets-built   List of all targets currently built.
  --host-target     Target triple used to configure LLVM.
  --build-mode      Print build mode of LLVM tree (e.g. Debug or Release).
  --assertion-mode  Print assertion mode of LLVM tree (ON or OFF).
Typical components:
  all               All LLVM libraries (default).
  engine            Either a native JIT or a bitcode interpreter.

@rheiland
Copy link
Collaborator Author

rheiland commented Oct 13, 2018

I switched back to OSX (from Ubuntu) to try to build from source. My previous success building a simple test was on OSX, but used your libs/headers.

I was using cmake 3.11.2 and kept getting this error:
CMake Error at src/CMakeLists.txt:194 (target_link_libraries):
Object library target "sbmlsolver_obj" may not link to anything.

It took me awhile to realize it was not coming from the CMakeLists.txt in your sbmlsolver root dir, but the one in the /src dir. Duh. The error was due to this section:
if(BUILD_LLVM)
target_link_libraries(sbmlsolver_obj
${LLVM_LIBRARIES}
)
So, I tried to specify the location of the LLVM_LIBRARIES as a CMake var on my command line, but still no luck. Then I decided to install the latest released version of cmake, even though it's only slightly newer at 3.12.3. This seemed to bypass the error generated above and let me continue to build the libs.

Oh, and no, I'm still not using ccmake (the GUI). I did attempt it at one point in this slog, but, as expected, it automatically picks up my Xcode stack and I want to use our/PhysiCell g++ w/ OpenMP stack. Oh, and I don't want to have to reset all the entries that need to be reset every time I open the GUI (which will be many times). That's the beauty of specifying CMake vars from the shell. As I mentioned, I used CMake for a few years. I've been through this world. This is the workflow that I use and, IMO, is the easiest for new users. Copy/paste.

So, this is what I do/now have (and this is without appending my PATH to use the ~/local/bin/llvm* commands, including llvm-config, built previously):

~/dev/sbmlsolver_build$ cmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-8 -DCMAKE_CXX_COMPILER:FILEPATH=/usr/local/bin/g++-8 -DSBMLSOLVER_DEP_DIR=$HOME/local -DCMAKE_INSTALL_PREFIX=$HOME/local ~/git/sbmlsolver
...
~/dev/sbmlsolver_build$ make -j8
...
~/dev/sbmlsolver_build$ ll
total 80
-rw-r--r-- 1 heiland staff 21375 Oct 13 11:45 CMakeCache.txt
drwxr-xr-x 14 heiland staff 476 Oct 13 11:50 CMakeFiles/
-rw-r--r-- 1 heiland staff 10983 Oct 13 11:45 Makefile
drwxr-xr-x 7 heiland staff 238 Oct 13 11:45 apps/
drwxr-xr-x 14 heiland staff 476 Oct 13 11:50 bin/
-rw-r--r-- 1 heiland staff 2236 Oct 13 11:45 cmake_install.cmake
drwxr-xr-x 5 heiland staff 170 Oct 13 11:45 include/
drwxr-xr-x 5 heiland staff 170 Oct 13 11:45 installer/
drwxr-xr-x 7 heiland staff 238 Oct 13 11:49 lib/
drwxr-xr-x 6 heiland staff 204 Oct 13 11:45 models/
drwxr-xr-x 9 heiland staff 306 Oct 13 11:45 src/
drwxr-xr-x 5 heiland staff 170 Oct 13 11:45 testing/
drwxr-xr-x 6 heiland staff 204 Oct 13 11:45 wrappers/

~/dev/sbmlsolver_build$ ll lib/
total 285352
-rw-r--r-- 1 heiland staff 39055768 Oct 13 11:49 libsbmlsolver.a
-rwxr-xr-x 1 heiland staff 53536760 Oct 13 11:49 libsbmlsolver.dylib*
drwxr-xr-x 3 heiland staff 102 Oct 13 11:49 libsbmlsolver.dylib.dSYM/
-rwxr-xr-x 1 heiland staff 53501536 Oct 13 11:49 libsbmlsolver_c_api.dylib*
drwxr-xr-x 3 heiland staff 102 Oct 13 11:49 libsbmlsolver_c_api.dylib.dSYM/

Next steps:

  • see if I can build my simple test using these newly built libs on OSX
  • switch back to Ubuntu, make sure I have the latest version of cmake, and try to build there following this same recipe
  • repeat on Win/MinGW

@rheiland
Copy link
Collaborator Author

My own build working on OSX:

~/dev/sbmlsolver_test$ ls
MxReactionNetwork.h	mx_port.h		test_mx.cpp

~/dev/sbmlsolver_test$ g++-8 test_mx.cpp  -L$HOME/local/lib -lsbmlsolver -o test_mx

but need to append to DYLD_LIBRARY_PATH:

$ export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$HOME/local/lib

~/dev/sbmlsolver_test$ ./test_mx 
we’re good, made a solver, ready to use it
ready to use the scalar system, connect it to our compartment

@rheiland
Copy link
Collaborator Author

rheiland commented Oct 13, 2018

On Ubuntu 18.04, I upgraded my cmake to:

$ cmake --version
cmake version 3.12.3

installed curses (otherwise had an error when running cmake to configure sbmlsolver):

$ sudo apt-get install libncurses5-dev libncursesw5-dev

appended the path to the new shared libs and made llvm-config available in my PATH

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/local/lib
$ export PATH=$PATH:$HOME/local/bin

Ran cmake:

heiland@ubu18:~/dev/sbmlsolver_build$ cmake  -DSBMLSOLVER_DEP_DIR=$HOME/local -DCMAKE_INSTALL_PREFIX=$HOME/local ~/git/sbmlsolver
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
is dir: /home/heiland/local
-- Looking for LLVM installed without CMake
-- LLVM llvm-config found at: /home/heiland/local/bin/llvm-config
-- LLVM_VERSION_MAJOR: 3
-- LLVM_VERSION_MINOR: 5
-- LLVM_VERSION_PATCH: .0svn
-- LLVM_BIN_DIR: /home/heiland/local/bin

-- LLVM_LIB_DIR: /home/heiland/local/lib

-- LLVM_INCLUDE_DIRS: /home/heiland/local/include
-- LLVM_LIBRARY_DIRS:  /home/heiland/local/lib
-- LLVM_DEFINITIONS: -I/home/heiland/local/include  -fPIC        -Wno-maybe-uninitialized  -Wno-comment -std=c++11 -ffunction-sections -fdata-sections   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- LLVM_LIBRARIES: /home/heiland/local/lib/libLLVMX86Disassembler.a;/home/heiland/local/lib/libLLVMX86AsmParser.a;/home/heiland/local/lib/libLLVMX86CodeGen.a;/home/heiland/local/lib/libLLVMSelectionDAG.a;/home/heiland/local/lib/libLLVMAsmPrinter.a;/home/heiland/local/lib/libLLVMX86Desc.a;/home/heiland/local/lib/libLLVMObject.a;/home/heiland/local/lib/libLLVMMCParser.a;/home/heiland/local/lib/libLLVMBitReader.a;/home/heiland/local/lib/libLLVMX86Info.a;/home/heiland/local/lib/libLLVMX86AsmPrinter.a;/home/heiland/local/lib/libLLVMX86Utils.a;/home/heiland/local/lib/libLLVMJIT.a;/home/heiland/local/lib/libLLVMExecutionEngine.a;/home/heiland/local/lib/libLLVMCodeGen.a;/home/heiland/local/lib/libLLVMScalarOpts.a;/home/heiland/local/lib/libLLVMInstCombine.a;/home/heiland/local/lib/libLLVMTransformUtils.a;/home/heiland/local/lib/libLLVMipa.a;/home/heiland/local/lib/libLLVMAnalysis.a;/home/heiland/local/lib/libLLVMTarget.a;/home/heiland/local/lib/libLLVMMC.a;/home/heiland/local/lib/libLLVMCore.a;/home/heiland/local/lib/libLLVMSupport.a
LLVM VERSION >= 3.4, looking for curses library
-- Found Curses: /usr/lib/x86_64-linux-gnu/libcurses.so
LLVM > 3.4, looking for zlib
-- Found ZLIB: /usr/lib/x86_64-linux-gnu/libz.so (found version "1.2.11")
LLVM_LIBRARIES: /home/heiland/local/lib/libLLVMX86Disassembler.a;/home/heiland/local/lib/libLLVMX86AsmParser.a;/home/heiland/local/lib/libLLVMX86CodeGen.a;/home/heiland/local/lib/libLLVMSelectionDAG.a;/home/heiland/local/lib/libLLVMAsmPrinter.a;/home/heiland/local/lib/libLLVMX86Desc.a;/home/heiland/local/lib/libLLVMObject.a;/home/heiland/local/lib/libLLVMMCParser.a;/home/heiland/local/lib/libLLVMBitReader.a;/home/heiland/local/lib/libLLVMX86Info.a;/home/heiland/local/lib/libLLVMX86AsmPrinter.a;/home/heiland/local/lib/libLLVMX86Utils.a;/home/heiland/local/lib/libLLVMJIT.a;/home/heiland/local/lib/libLLVMExecutionEngine.a;/home/heiland/local/lib/libLLVMCodeGen.a;/home/heiland/local/lib/libLLVMScalarOpts.a;/home/heiland/local/lib/libLLVMInstCombine.a;/home/heiland/local/lib/libLLVMTransformUtils.a;/home/heiland/local/lib/libLLVMipa.a;/home/heiland/local/lib/libLLVMAnalysis.a;/home/heiland/local/lib/libLLVMTarget.a;/home/heiland/local/lib/libLLVMMC.a;/home/heiland/local/lib/libLLVMCore.a;/home/heiland/local/lib/libLLVMSupport.a;/usr/lib/x86_64-linux-gnu/libcurses.so;/usr/lib/x86_64-linux-gnu/libform.so;/usr/lib/x86_64-linux-gnu/libz.so
-- Found LLVM: /home/heiland/local/include
-- Using third party library prefix of /home/heiland/local
-- Installing RoadRunner to /home/heiland/local
-- Found LibXml2: /usr/lib/x86_64-linux-gnu/libxml2.so (found version "2.9.4")
-- found libxml2, include dir: /usr/include/libxml2
-- using LLVM, version 3.5..0svn
-- LLVM_LIBRARIES: /home/heiland/local/lib/libLLVMX86Disassembler.a;/home/heiland/local/lib/libLLVMX86AsmParser.a;/home/heiland/local/lib/libLLVMX86CodeGen.a;/home/heiland/local/lib/libLLVMSelectionDAG.a;/home/heiland/local/lib/libLLVMAsmPrinter.a;/home/heiland/local/lib/libLLVMX86Desc.a;/home/heiland/local/lib/libLLVMObject.a;/home/heiland/local/lib/libLLVMMCParser.a;/home/heiland/local/lib/libLLVMBitReader.a;/home/heiland/local/lib/libLLVMX86Info.a;/home/heiland/local/lib/libLLVMX86AsmPrinter.a;/home/heiland/local/lib/libLLVMX86Utils.a;/home/heiland/local/lib/libLLVMJIT.a;/home/heiland/local/lib/libLLVMExecutionEngine.a;/home/heiland/local/lib/libLLVMCodeGen.a;/home/heiland/local/lib/libLLVMScalarOpts.a;/home/heiland/local/lib/libLLVMInstCombine.a;/home/heiland/local/lib/libLLVMTransformUtils.a;/home/heiland/local/lib/libLLVMipa.a;/home/heiland/local/lib/libLLVMAnalysis.a;/home/heiland/local/lib/libLLVMTarget.a;/home/heiland/local/lib/libLLVMMC.a;/home/heiland/local/lib/libLLVMCore.a;/home/heiland/local/lib/libLLVMSupport.a;/usr/lib/x86_64-linux-gnu/libcurses.so;/usr/lib/x86_64-linux-gnu/libform.so;/usr/lib/x86_64-linux-gnu/libz.so
-- LLVM_DEFINITIONS: -I/home/heiland/local/include  -fPIC        -Wno-maybe-uninitialized  -Wno-comment -std=c++11 -ffunction-sections -fdata-sections   -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS
-- LLVM_INCLUDE_DIRS: /home/heiland/local/include
-- LLVM_LIBRARY_DIRS: /home/heiland/local/lib
CRN_PUBLIC_HEADERS: MxReactionNetwork.h
found git: /usr/bin/git
ROADRUNNER_GIT_BRANCH develop
ROADRUNNER_GIT_LAST_COMMIT: 1393f795527e219e69e5cac8eb493ece9c60b7b2
SBMLSOLVER_DEP_DIR: /home/heiland/local/include
-- *** headers *** /home/heiland/git/sbmlsolver/src/./CVODEIntegrator.h;/home/heiland/git/sbmlsolver/src/./Dictionary.h;/home/heiland/git/sbmlsolver/src/./DoxygenDocs.h;/home/heiland/git/sbmlsolver/src/./DummyScalarSystem.h;/home/heiland/git/sbmlsolver/src/./EulerIntegrator.h;/home/heiland/git/sbmlsolver/src/./ExecutableModelFactory.h;/home/heiland/git/sbmlsolver/src/./GillespieIntegrator.h;/home/heiland/git/sbmlsolver/src/./Integrator.h;/home/heiland/git/sbmlsolver/src/./RK4Integrator.h;/home/heiland/git/sbmlsolver/src/./SBMLSolver.h;/home/heiland/git/sbmlsolver/src/./SBMLSolverOptions.h;/home/heiland/git/sbmlsolver/src/./SBMLValidator.h;/home/heiland/git/sbmlsolver/src/./Variant.h;/home/heiland/git/sbmlsolver/src/./msc_stdint.h;/home/heiland/git/sbmlsolver/src/./rrCompiler.h;/home/heiland/git/sbmlsolver/src/./rrConfig.h;/home/heiland/git/sbmlsolver/src/./rrConstants.h;/home/heiland/git/sbmlsolver/src/./rrException.h;/home/heiland/git/sbmlsolver/src/./rrExecutableModel.h;/home/heiland/git/sbmlsolver/src/./rrExporter.h;/home/heiland/git/sbmlsolver/src/./rrFileName.h;/home/heiland/git/sbmlsolver/src/./rrGetOptions.h;/home/heiland/git/sbmlsolver/src/./rrIniFile.h;/home/heiland/git/sbmlsolver/src/./rrIniKey.h;/home/heiland/git/sbmlsolver/src/./rrIniSection.h;/home/heiland/git/sbmlsolver/src/./rrLogger.h;/home/heiland/git/sbmlsolver/src/./rrNLEQInterface.h;/home/heiland/git/sbmlsolver/src/./rrOSSpecifics.h;/home/heiland/git/sbmlsolver/src/./rrRoadRunnerData.h;/home/heiland/git/sbmlsolver/src/./rrSBMLModelSimulation.h;/home/heiland/git/sbmlsolver/src/./rrSBMLReader.h;/home/heiland/git/sbmlsolver/src/./rrSelectionRecord.h;/home/heiland/git/sbmlsolver/src/./rrSparse.h;/home/heiland/git/sbmlsolver/src/./rrSteadyStateSolver.h;/home/heiland/git/sbmlsolver/src/./rrStringUtils.h;/home/heiland/git/sbmlsolver/src/./rrTestSuiteModelSimulation.h;/home/heiland/git/sbmlsolver/src/./rrUtils.h;/home/heiland/git/sbmlsolver/src/./rrVersionInfo.h;/home/heiland/git/sbmlsolver/src/./rr_pch.h
-- *** headers *** /home/heiland/git/sbmlsolver/src/tr1proxy/cxx11_ns.h;/home/heiland/git/sbmlsolver/src/tr1proxy/rr_memory.h;/home/heiland/git/sbmlsolver/src/tr1proxy/rr_random.h;/home/heiland/git/sbmlsolver/src/tr1proxy/rr_unordered_map.h
-- Testing/utils...
-- C++ compiler version: 7.3.0 [GNU]
-- bitness: 64
-- bitness: linux
-- bitness: amd64
-- Linux-4.15.0-34-generic
-- building tests
-- Configuring done
-- Generating done
-- Build files have been written to: /home/heiland/dev/sbmlsolver_build

Get an error when compiling:

heiland@ubu18:~/dev/sbmlsolver_build$ make
...
[ 57%] Built target sbmlsolver_obj
[ 58%] Built target sbmlsolver_shared
[ 59%] Built target sbmlsolver_static
[ 60%] Linking CXX shared library ../../lib/libsbmlsolver_c_api.so
../../lib/libsbmlsolver.a(rrUtils.cpp.o): In function `rr::getCurrentSharedLibDir[abi:cxx11]()':
/home/heiland/git/sbmlsolver/src/rrUtils.cpp:177: undefined reference to `dladdr'
/home/heiland/local/lib/libLLVMSupport.a(DynamicLibrary.cpp.o): In function `llvm::sys::DynamicLibrary::getPermanentLibrary(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)':
DynamicLibrary.cpp:(.text._ZN4llvm3sys14DynamicLibrary19getPermanentLibraryEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x4b): undefined reference to `dlopen'
DynamicLibrary.cpp:(.text._ZN4llvm3sys14DynamicLibrary19getPermanentLibraryEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x64): undefined reference to `dlerror'
DynamicLibrary.cpp:(.text._ZN4llvm3sys14DynamicLibrary19getPermanentLibraryEPKcPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0xf0): undefined reference to `dlclose'
/home/heiland/local/lib/libLLVMSupport.a(DynamicLibrary.cpp.o): In function `llvm::sys::DynamicLibrary::getAddressOfSymbol(char const*)':
DynamicLibrary.cpp:(.text._ZN4llvm3sys14DynamicLibrary18getAddressOfSymbolEPKc+0x3c): undefined reference to `dlsym'
/home/heiland/local/lib/libLLVMSupport.a(DynamicLibrary.cpp.o): In function `llvm::sys::DynamicLibrary::SearchForAddressOfSymbol(char const*)':
DynamicLibrary.cpp:(.text._ZN4llvm3sys14DynamicLibrary24SearchForAddressOfSymbolEPKc+0x13b): undefined reference to `dlsym'
/home/heiland/local/lib/libLLVMSupport.a(Signals.cpp.o): In function `llvm::sys::PrintStackTrace(_IO_FILE*)':
Signals.cpp:(.text._ZN4llvm3sys15PrintStackTraceEP8_IO_FILE+0x71): undefined reference to `dladdr'
Signals.cpp:(.text._ZN4llvm3sys15PrintStackTraceEP8_IO_FILE+0x101): undefined reference to `dladdr'
collect2: error: ld returned 1 exit status
wrappers/C/CMakeFiles/sbmlsolver_c_api.dir/build.make:246: recipe for target 'lib/libsbmlsolver_c_api.so' failed
make[2]: *** [lib/libsbmlsolver_c_api.so] Error 1
CMakeFiles/Makefile2:511: recipe for target 'wrappers/C/CMakeFiles/sbmlsolver_c_api.dir/all' failed
make[1]: *** [wrappers/C/CMakeFiles/sbmlsolver_c_api.dir/all] Error 2
Makefile:129: recipe for target 'all' failed
make: *** [all] Error 2

There seems to be lots of online discussion of such errors, e.g. link

Oddly, in spite of the linking errors above, it does create a lib:

heiland@ubu18:~/dev/sbmlsolver_build$ ll lib/
total 145028
drwxr-xr-x  2 heiland heiland     4096 Oct 13 16:40 ./
drwxr-xr-x 12 heiland heiland     4096 Oct 13 16:36 ../
-rw-r--r--  1 heiland heiland 55434754 Oct 13 16:40 libsbmlsolver.a
-rwxr-xr-x  1 heiland heiland 93060888 Oct 13 16:40 libsbmlsolver.so*

but a blind attempt to use it in our test pgm fails, not surprisingly:

heiland@ubu18:~/dev/sbmlsolver_test$ ls
mx_port.h  MxReactionNetwork.h  test_mx.cpp

heiland@ubu18:~/dev/sbmlsolver_test$ g++ test_mx.cpp -L$HOME/dev/sbmlsolver_build/lib  -lsbmlsolver
heiland@ubu18:~/dev/sbmlsolver_test$ ./a.out 
failed to make a solver, need to check the error code, figure out what happened
Segmentation fault (core dumped)

@AndySomogyi AndySomogyi self-assigned this Oct 14, 2018
@AndySomogyi
Copy link
Owner

AndySomogyi commented Oct 14, 2018

I haven't tested the new build on Linux yet, but this is a trivial fix. I removed a line of the unix build. I know this exact error, and what line to charge to fix it.

Just let me get a Linux installed, and I'll get you binaries, and I'll even get you a .deb.

We need to start talking about the API and then I'll provide binaries for all three packages on a daily basis.

I'll look into how GitHub continuous integration with Travis works, so that'll automatically compile and build on each checking.

@rheiland
Copy link
Collaborator Author

rheiland commented Oct 14, 2018 via email

@AndySomogyi
Copy link
Owner

I haven't made the fix, but I know what the fix is. I'll try to test it on Linux maybe tomorrow, then get binaries out for Linux. I make binaries that are Linux distro independent.

@rheiland
Copy link
Collaborator Author

rheiland commented Oct 14, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants