Page 1 of 1

Issues with SimVascular compilation from source on Linux

Posted: Wed Mar 06, 2019 4:25 pm
by esauvage
Dear SimVascular community,

I have some trouble compiling SimVascular from source and would like to ask for help. I checked out the source code and created a separate build directory. My folders are organized as follows:

work/SimVascularSrc.git
work/SimVascularSrc_build

I followed the the instructions at http://simvascular.github.io/docsCompile.html ('Building it all'), and did the following:

cd work/SimvascularSrc_build
ccmake ../SimvascularSrc.git

I configured the build, generated makefiles and then typed 'make'. The build process, however, stops almost immediately with the following error:

CMake Error at /home/emilie/work/SimVascularSrc.git/Code/CMake/SimVascularMacros.cmake:1366 (message):
The operating system does not have any available pre-built binaries. See
the build documentation to build your own.
Call Stack (most recent call first):
CMake/SvExtOptions.cmake:79 (sv_externals_add_new_external)
CMakeLists.txt:95 (include)

I don't know how to tell CMake that it should NOT look for prebuilt binaries but compile everything from source (which I thought was the default behaviour anyway).

My second attempt was with one of the build scripts shipped with SimVascular.

I took cmake-build-linux-download-externals.sh and slightly modified it in order to fit my setup. The script is placed in 'work' and its first part
looks as follows:

export SIMVASC_SRC_DIR="$PWD/SimVascularSrc.git"

rm -Rf $SIMVASC_SRC_DIR/Code/DownloadExternalsBuild
mkdir -p $SIMVASC_SRC_DIR/Code/DownloadExternalsBuild
pushd $SIMVASC_SRC_DIR/Code/DownloadExternalsBuild

#compilers
export CC="gcc"
export CXX="g++"

#cmake
export REPLACEME_SV_CMAKE_CMD="cmake"
export REPLACEME_SV_CMAKE_GENERATOR="Unix Makefiles"
export REPLACEME_SV_CMAKE_BUILD_TYPE="RelWithDebInfo"
export REPLACEME_SV_MAKE_CMD="make -j8"
export REPLACEME_SV_TOP_SRC_DIR_SV="$SIMVASC_SRC_DIR"

#Qt5
export Qt5_DIR="/opt/gcc/Qt5.4.2/5.4/gcc_64/lib/cmake/Qt5"
export EXTERNALS_DIR="/opt/gcc/simvasc/ext"

The rest was left without change. When I run the script, it stops almost immediately and stdout-cmake-config.txt contains some generic information followed by

-- Configuring done
-- Generating /home/emilie/work/SimVascularSrc.git/Code/DownloadExternalsBuild
Called from: [1] /home/emilie/work/SimVascularSrc.git/CMakeLists.txt
-- Generating done
CMake Warning:
Manually-specified variables were not used by the project:

BUILD_SHARED_LIBS
BUILD_TESTING
SV_DOWNLOAD_EXTERNALS
SV_EXTERNALS_TOPLEVEL_DIR
SV_EXTERNALS_USE_TOPLEVEL_DIR
SV_USE_FREETYPE
SV_USE_FREETYPE_SHARED
SV_USE_GDCM
SV_USE_GDCM_SHARED
SV_USE_ITK
SV_USE_ITK_SHARED
SV_USE_MITK
SV_USE_MITK_SHARED
SV_USE_MMG
SV_USE_MPICH2
SV_USE_OpenCASCADE
SV_USE_OpenCASCADE_SHARED
SV_USE_PYTHON
SV_USE_QT_GUI
SV_USE_SYSTEM_FREETYPE
SV_USE_SYSTEM_GDCM
SV_USE_SYSTEM_ITK
SV_USE_SYSTEM_MITK
SV_USE_SYSTEM_MMG
SV_USE_SYSTEM_OpenCASCADE
SV_USE_SYSTEM_PYTHON
SV_USE_SYSTEM_TCL
SV_USE_SYSTEM_VTK
SV_USE_TCL_SHARED
SV_USE_VTK_SHARED


-- Build files have been written to: /home/emilie/work/SimVascularSrc.git/Code/DownloadExternalsBuild

I don't understand why all variables are reported as unused. Am I doing something wrong? In addition to this, stdout-compile.txt shows that the compilation terminated almost immediately with an error:

-- The C compiler identification is GNU 8.2.1
-- The CXX compiler identification is GNU 8.2.1
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- 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/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- SimVascular Version: simvascular 2019-03-06
SV_BUILD_TYPE_DIR: relwithdebinfo
CMake Error at /home/emilie/work/SimVascularSrc.git/Code/CMake/SimVascularMacros.cmake:1366 (message):
The operating system does not have any available pre-built binaries. See
the build documentation to build your own.
Call Stack (most recent call first):
CMake/SvExtOptions.cmake:79 (sv_externals_add_new_external)
CMakeLists.txt:95 (include)


-- Configuring incomplete, errors occurred!
See also "/home/emilie/work/SimVascularSrc.git/Code/DownloadExternalsBuild/Externals-build/CMakeFiles/CMakeOutput.log".
make[2]: *** [CMakeFiles/Externals.dir/build.make:106: Externals-prefix/src/Externals-stamp/Externals-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/Externals.dir/all] Error 2
make: *** [Makefile:84: all] Error 2

AS a last attempt, I modified the build script again and set

-DSV_DOWNLOAD_EXTERNALS=OFF

hoping that this would force CMake to compile all externals. Not surprisingly, this didn't work (as I said above, all SV_* variables were for some reason ignored ...)

Could you please help me and tell me what am I doing wrong? I would like to compile SimVascular from sources, preferably with all externals compiled as well. I don't seem to be able to actually force SimVascular to attempt the compilation.

Thank you very much in advance for your help.

Kind regards,

Emilie

Re: Issues with SimVascular compilation from source on Linux

Posted: Wed Mar 06, 2019 6:07 pm
by gmaher
Hi Emilie,

What distribution and version of linux are you building on?

We have precompiled versions of all the externals which are normally downloaded when building SimVascular, usually this works fine and is the recommended process.

Is there a particular reason you want to build everything from source?

Best,

Gabriel

Re: Issues with SimVascular compilation from source on Linux

Posted: Thu Mar 07, 2019 5:23 am
by esauvage
Dear Gabriel,

Thank you for your reply.
The instructions on SimVascular website say (now I quote):

Downloading SimVascular's Externals
To download the most basic version of the externals, navigate to the externals, create a build directory, and configure:

cd SimVascularSrc/Externals
mkdir Build
cd Build
ccmake ..
By default, all externals should be set to be downloaded. To turn on and off certain externals, toggle the SVEXTERNALSENABLE "External" variables.
(end of quote)

I followed these instructions exactly as written and after pressing "c" for "configure" in ccmake for multiple times, all I see is this:

CMake Error at /home/emilie/work/SimVascularSrc.git/Code/CMake/SimVascularMacros.cmake:1366 (message):
The operating system does not have any available pre-built binaries. See
the build documentation to build your own.
Call Stack (most recent call first):
CMake/SvExtOptions.cmake:79 (sv_externals_add_new_external)
CMakeLists.txt:95 (include)

In other words, I'm not able to download the prebuilt externals. I would prefer to compile everything from source to ensure full binary compatibility with other (compiled) packages in my system, but if prebuilt externals will do the job, I'd be happy with that as well. As of now,
I'm not able to do either. In addition to that, I don't see any SVEXTERNALSENABLE'External variables.

My linux distribution is ArchLinux and my CMake version is 3.13.4 if that's of any relevance.

Thank you very much for your help.
Kind regards,

Emilie

Re: Issues with SimVascular compilation from source on Linux

Posted: Tue Mar 12, 2019 10:26 am
by nwilson
Hello Emilie,

We don't support Arch Linux. Our current build platforms are:

Ubuntu 14+ (soon to be only 16+)
CentOS 7(limited support)
Windows 10
MacOS 10.11 (soon to be only 10.12+)

For these platforms, we provide prebuilt binaries of the external open source packages (e.g. VTK, ITK, etc.). Compiling these packages is extremely, extremely complicated and can only be done by an expert. It requires exact versions numbers, required system libraries, etc. and takes typically 3+ hours of compilation if all goes right.

Once you have all the externals built, then you can build all of the SimVascular code from source (this takes maybe 15 minutes or so). If you get all the externals to build, my experience is that the actual SimVascular code will build with minor tweaks.

We welcome this addition if you want to try it, but we don't have the bandwidth to do it or provide meaningful help as we don't have any systems running Arch Linux.

A few additional comments:

1. The "BuildScripts" is out of date and unused. I will delete it from the distribution to avoid future confusion.

2. Building the externals from CMake partially works (mostly for MacOS). I personally use the Make build to build the externals. It makes sense to me (of course, I made it), but the basic steps on Ubuntu 16 are:

% cd Externals/Prep/2019.02
% ./ubuntu-16-prep.sh

% cd Externals/Make/2019.02
% ./build-sv-externals-linux.sh

If you are an experienced user and have built numerous open source packages, it should be fairly straightforward to update all the shell scripts for arch linux under Externals/Make/2019.02. You can compare the sed-script and file differences for centos and ubuntu which should give some insight to common differences.

3. I am in the processing of updating the externals from 2018.05 to 2019.02. The 2019.02 build should work for Windows and Linux but still needs to be tested and updated for MacOS.

Nathan
SimVascular Support Team