OpenCMISS / manage

The main project for CMake-based OpenCMISS builds
Apache License 2.0
3 stars 15 forks source link

Unable to build Zinc library #112

Open dbrnz opened 3 years ago

dbrnz commented 3 years ago

The instructions at http://opencmiss.org/documentation/building/cmake/setup/docs/cli/osx.html fail when attempting to build OC_ZINC, apparently because OpenCMISS dependencies haven't been installed before the Zinc build.

Is there a rule missing from Zinc's CMakeLists.txt??

.
.
[ 36%] Support: Creating NETGEN buildlog
[ 36%] Built target SM_NETGEN_build_log
[ 39%] Built target OC_NETGEN
[ 39%] Support: Creating GTEST buildlog
[ 39%] Built target SM_GTEST_build_log
[ 42%] Built target OC_GTEST
[ 43%] Support: Creating FIELDML-API buildlog
[ 43%] Built target SM_FIELDML-API_build_log
[ 45%] Built target OC_FIELDML-API
[ 45%] Performing configure step for 'OC_ZINC'
CMake Error at extproj/stamp/OC_ZINC-configure-Release.cmake:49 (message):
  Command failed: 1

   '/usr/local/Cellar/cmake/3.20.1/bin/cmake' '--no-warn-unused-cli' '-DCMAKE_PREFIX_PATH=/Users/dave/build/OpenCMISS/opencmiss/install/cmake' '-DCMAKE_MODULE_PATH=/Users/dave/build/OpenCMISS/opencmiss/install/share/cmake/Modules/OpenCMISS;/Users/dave/build/OpenCMISS/opencmiss/install/share/cmake/Modules/FindModuleWrappers;/Users/dave/build/OpenCMISS/opencmiss/install/share/cmake/Modules' '-DPACKAGE_CONFIG_DIR=cmake' '-DCMAKE_NO_SYSTEM_FROM_IMPORTED=YES' '-DCMAKE_DEBUG_POSTFIX=d' '-DCMAKE_POSITION_INDEPENDENT_CODE=YES' '-DOPENCMISS_INSTRUMENTATION=' '-DWARN_ALL=YES' '-DCHECK_ALL=YES' '-DCMAKE_INSTALL_DEFAULT_COMPONENT_NAME=Development' '-DCMAKE_INSTALL_PREFIX:PATH=/Users/dave/build/OpenCMISS/opencmiss/install' '-DCMAKE_BUILD_TYPE=Release' '-DBUILD_SHARED_LIBS=ON' '-DCMAKE_C_COMPILER=/usr/local/opt/ccache/libexec/clang' '-DCMAKE_C_FLAGS=-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include' '-DCMAKE_C_FLAGS_RELEASE=-O3 -DNDEBUG' '-DCMAKE_C_FLAGS_DEBUG=-g' '-DCMAKE_CXX_COMPILER=/usr/local/opt/ccache/libexec/clang++' '-DCMAKE_CXX_FLAGS_RELEASE=-O3 -DNDEBUG' '-DCMAKE_CXX_FLAGS_DEBUG=-g' '-DCMAKE_Fortran_COMPILER=/usr/local/bin/gfortran' '-DCMAKE_Fortran_FLAGS_RELEASE=-O3 -DNDEBUG -O3' '-DCMAKE_Fortran_FLAGS_DEBUG=-g' '-DZLIB_FIND_SYSTEM=OFF' '-DZLIB_VERSION=1.2.3' '-DLIBXML2_FIND_SYSTEM=ON' '-DLIBXML2_VERSION=2.7.6' '-DBZIP2_FIND_SYSTEM=OFF' '-DBZIP2_VERSION=1.0.6' '-DFIELDML-API_FIND_SYSTEM=OFF' '-DFIELDML-API_VERSION=0.5.0' '-DFREETYPE_FIND_SYSTEM=ON' '-DFREETYPE_VERSION=2.4.10' '-DFTGL_FIND_SYSTEM=OFF' '-DFTGL_VERSION=2.1.3' '-DOPTPP_FIND_SYSTEM=OFF' '-DOPTPP_VERSION=681' '-DGLEW_FIND_SYSTEM=OFF' '-DGLEW_VERSION=1.5.5' '-DNETGEN_FIND_SYSTEM=OFF' '-DNETGEN_VERSION=4.9.11' '-DPNG_FIND_SYSTEM=OFF' '-DPNG_VERSION=1.5.2' '-DJPEG_FIND_SYSTEM=ON' '-DJPEG_VERSION=6.0.0' '-DGTEST_FIND_SYSTEM=OFF' '-DGTEST_VERSION=1.7.0' '-DITK_FIND_SYSTEM=OFF' '-DITK_VERSION=3.20.0' '-DIMAGEMAGICK_FIND_SYSTEM=OFF' '-DIMAGEMAGICK_VERSION=6.7.0.8' '-DZINC_USE_IMAGEMAGICK=ON' '-DZINC_USE_ITK=ON' '-DZINC_BUILD_TESTS=TRUE}' '-DZINC_BUILD_BINDINGS=TRUE' '-DZINC_BUILD_PYTHON_BINDINGS=ON' '-DZINC_PACKAGE_CONFIG_DIR=cmake' '-DZINC_DEPENDENCIES_INSTALL_PREFIX=/georges/house' '-DZINC_VIRTUALENV_INSTALL_PREFIX=/Users/dave/build/OpenCMISS/opencmiss/install/virtual_environments' '-DZINC_USE_VIRTUALENV=YES' '-GUnix Makefiles' '/Users/dave/build/OpenCMISS/opencmiss/src/zinc'

  See also

    /Users/dave/build/OpenCMISS/opencmiss/build/zinc/release/extproj/stamp/OC_ZINC-configure-*.log

make[5]: *** [/Users/dave/build/OpenCMISS/opencmiss/build/zinc/release/extproj/stamp/OC_ZINC-configure] Error 1
make[4]: *** [CMakeFiles/OC_ZINC.dir/all] Error 2
make[3]: *** [all] Error 2
make[2]: *** [config/Release/stamp/manage_config-build] Error 2
make[1]: *** [CMakeFiles/manage_config.dir/all] Error 2
make: *** [all] Error 2

with the error log containing:

CMake Error at CMakeLists.txt:25 (find_package):
  By not providing "FindOPENCMISSDEPENDENCIES.cmake" in CMAKE_MODULE_PATH
  this project has asked CMake to find a package configuration file provided
  by "OPENCMISSDEPENDENCIES", but CMake did not find one.

  Could not find a package configuration file provided by
  "OPENCMISSDEPENDENCIES" with any of the following names:

    OPENCMISSDEPENDENCIESConfig.cmake
    opencmissdependencies-config.cmake

  Add the installation prefix of "OPENCMISSDEPENDENCIES" to CMAKE_PREFIX_PATH
  or set "OPENCMISSDEPENDENCIES_DIR" to a directory containing one of the
  above files.  If "OPENCMISSDEPENDENCIES" provides a separate development
  package or SDK, be sure it has been installed.
dbrnz commented 3 years ago

@hsorby do you have any quick thoughts on this? From the commit log I see you've recently made changes in this area.

By hacking the CMake files I've managed to build Zinc's dependencies but am now having problems in getting the Zinc build to use these dependencies, with errors such as:

CMake Error at /Users/dave/build/OpenCMISS/opencmiss/install/opencmissdependencies-config.cmake:81 (message):
  Mismatch between the current context toolchain () and the toolchain in use
  (clang).

I'm wanting this for flatmap automated path layout...

hsorby commented 3 years ago

If you need to build it now you will have to use these instructions:

Build the dependencies with these instructions

mkdir ocd
git clone https://github.com/opencmiss/setup.git
mkdir setup-build
cd setup-build
cmake -DOPENCMISS_LIBRARIES=zinc -DOPENCMISS_DEPENDENCIES_ROOT=<full-path-to-ocd-directory-created-above> -DOPENCMISS_SETUP_TYPE=dependencies ../setup
make

Then you can build Zinc like this

cd ..
git clone https://github.com/OpenCMISS/zinc.git
mkdir build-zinc-release
cd build-zinc-release
cmake -DOPENCMISSDEPENDENCIES_DIR:PATH=<full-path-to-ocd-directory-created-above>/install ../zinc
make
dbrnz commented 3 years ago

Thanks @hsorby, the above all worked (apart from a missing cd setup-build). I had realised a two stage build was needed but not worked out how to drive each stage.

hsorby commented 3 years ago

Corrected instructions above incase anybody else tries to run these commands.