--- Begin Message ---Hi,
- From: "Brad Hollister" <behollis@sci.utah.edu>
- To: scirun-users@lists.sci.utah.edu
- Subject: Re: [SCIRUN-USERS] cmake issues with scirun
- Date: Tue, 03 Nov 2015 16:28:17 -0700
- List-archive: <https://lists.sci.utah.edu/sympa/arc/scirun-users>
- List-id: <scirun-users.sci.utah.edu>
Actually, the flag / source_dir (CMAKE_SOURCE_DIR) order doesn't matter to cmake.
The way I fixed this issue was to move the CMakeLists.txt to the parent directory of Superbuild/ instead of being in Superbuild/ (since the source_dir can't be a sibling of where the actual source .cxx is located for Eclipse to find it).
Once that was done, then I had to update CMakeLists.txt by changing the line:
INCLUDE(${CMAKE_SOURCE_DIR}/Superbuild.cmake)
to this instead,
INCLUDE(${CMAKE_SOURCE_DIR}/Superbuild/Superbuild.cmake)
The above change required the lines of CMAKE_SOURCE_DIR/Superbuild/Superbuild.cmake:
SET(SUPERBUILD_DIR ${CMAKE_CURRENT_SOURCE_DIR} CACHE INTERNAL "" FORCE)
SET(SCIRUN_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src CACHE INTERNAL "" FORCE)
to be edited via,
SET(SUPERBUILD_DIR ${CMAKE_SOURCE_DIR}/Superbuild CACHE INTERNAL "" FORCE)
SET(SCIRUN_SOURCE_DIR ${CMAKE_SOURCE_DIR}/src CACHE INTERNAL "" FORCE)
since CMAKE_CURRENT_SOURCE_DIR would now be the parent of Superbuild/ in the former case.
If you want, I can create a pull request / patch for this...
Incidentally, I chose to create a separate sibling directory to SCIRun/ for an out-of-source build instead of SCIRun/bin/. So, from there, I ran:
cmake ../SCIRun/ -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug
Looks like this is working for Eclipse now. Here are some good references that I found:
http://playcontrol.net/ewing/screencasts/getting_started_with_cmake_.html
https://cmake.org/Wiki/CMake_Useful_Variables
Lastly, even though I did an out-of-source build (build directory sibling of CMAKE_SOURCE_DIR), from the following it looks like Eclipse prefers in-source builds which is ironically opposed to the CMake philosophy.
From:
https://cmake.org/Wiki/CMake:Eclipse_UNIX_Tutorial
https://cmake.org/Wiki/Eclipse_CDT4_Generator
"Note Regarding Out-Of-Source Builds: Eclipse CDT will work better if the the build directory is located within the source directory. Doing so makes it easier to configure Eclipse to Debug and Run your program. It is possible to store your build directory completely outside of the source directory however setting up the ability to debug and run your targets will be slightly more complicated. Regardless of how you set things up, it is currently not possible to use the same source directory with multiple Eclipse projects. Eclipse stores a .project and .cproject file in the root of each project (your source tree in this case) and keeps track of active projects. It will not allow you to reuse a source directory twice (as it views them as project directories)."
Either way, the problem I had encountered, which was that Eclipse was not finding the .cxx source files in the IDE, was due to the location of CMakeLists.txt and not an in-source versus out-of-source build.
Regards,
Brad
On Tue, 3 Nov 2015 12:29:53 -0700
Ayla Khan <ayla@sci.utah.edu> wrote:
Hi Brad,
Try instead: cmake -G"Eclipse CDT4 - Unix Makefiles" ../Superbuild/ from your build directory (empty, I assume?).
CMake should be invoked with the option flags first, then the path to the source CMakeLists.txt file, which is in the Superbuild directory.
Ayla
On Nov 2, 2015, at 4:56 PM, Brad Hollister wrote:
Thank you. The builds are now working for me. However, I have another question:
I want to set up an Eclipse development environment. CMake outputs Eclipse project files via:
cmake . -G"Eclipse CDT4 - Unix Makefiles"
When I execute this in bin/ (the build directory?), the project is missing the source files. Is there a different directory that I should generate the Eclipse project file from?
Regards,
Brad
P.S. This works for Blender. See: http://wiki.blender.org/index.php/Dev:Doc/IDE_Configuration/Linux_CMake_Eclipse
On Fri, 30 Oct 2015 21:51:22 -0600
"Daniel White" <dwhite@sci.utah.edu> wrote:
Ah, you found another known build quirk: you need to use an older version of cmake. We've been using 2.8.11 successfully. Hopefully we can get that fixed too.
On Fri, 30 Oct 2015 16:06:37 -0600
"Brad Hollister" <behollis@sci.utah.edu> wrote:
Hm. Okay, the first invocation of make fails. Here is the tail of the output:
Generating grammar tables from /home/behollis/SCII/scirun5/SCIRun/bin/Externals/Install/Python_external/lib/python3.4/lib2to3/PatternGrammar.txt
Writing grammar tables to /home/behollis/SCII/scirun5/SCIRun/bin/Externals/Install/Python_external/lib/python3.4/lib2to3/PatternGrammar3.4.3.final.0.pickle
[ 76%] Completed 'Python_external'
[ 76%] Built target Python_external
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
I've installed both the packages: 'qt4-dev-tools qt4-qmake' and the packages: 'qt5-dev-tools qt5-qmake', before going thru the procedure provided. Btw, this is all being done on Ubuntu 15.04.
When running ./build.sh, the build apparently fails as well.
CMake Warning (dev) at CMakeLists.txt:472 (EXPORT_LIBRARY_DEPENDENCIES):
Policy CMP0033 is not set: The export_library_dependencies command should
not be called. Run "cmake --help-policy CMP0033" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring incomplete, errors occurred!
See also "/home/behollis/SCII/SCIRun/bin/Externals/Build/Teem_external/CMakeFiles/CMakeOutput.log".
See also "/home/behollis/SCII/SCIRun/bin/Externals/Build/Teem_external/CMakeFiles/CMakeError.log".
CMakeFiles/Teem_external.dir/build.make:103: recipe for target 'Externals/Stamp/Teem_external/Teem_external-configure' failed
make[2]: *** [Externals/Stamp/Teem_external/Teem_external-configure] Error 1
CMakeFiles/Makefile2:347: recipe for target 'CMakeFiles/Teem_external.dir/all' failed
make[1]: *** [CMakeFiles/Teem_external.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
Building SCIRun returned an error
Either the code failed to build properly or
the testing programs failed to complete without
every single test program passing the test.
On Fri, 30 Oct 2015 15:04:27 -0600
Dan White <dwhite@sci.utah.edu> wrote:
Hi,
We've recently overhauled the build structure so our documentation is out of date. Other than Qt 4.8, SCIRun includes all external dependencies either as part of the source or as a git external project that gets downloaded as part of the build. Qt is the only dependency that needs to be separately built. No apt-getting or prefix_path setting should be required. The steps on a *nix system are as follows:
mkdir scirun5; cd scirun5
git clone https://github.com/SCIInstitute/SCIRun.git
cd SCIRun/bin
cmake ../Superbuild
# above line might be required TWICE
make -j4
# after success, you can cd SCIRun (that's right, SCIRun/bin/SCIRun), and just
make -j8
Or you could try the new build script, located under in the root called build.sh. Let us know if you run into difficulties. We'll update the build instructions soon.
Thanks,
Dan
On 10/30/2015 2:27 PM, Brad Hollister wrote:
To Whom It May Concern,
When running CMake for a SCIRun build, I am having the following issues...
I am able to set CMAKE_PREFIX_PATH to the Externals/ directory which prevents issues up until SQLite_external. When I install sqlite-dev via apt-get, and set SQLite_DIR accordingly, CMake still fails with the same repeated warning.
I've noticed a SCIRun/Superbuild directory that contains the external library *.cmake files. But, when pointing CMAKE_PREFIX_PATH to Superbuild/, CMake still fails to work.
Any suggestions?
CMake produces the initial following warnings before setting any of its variables:
CMake Warning at CMakeLists.txt:193 (MESSAGE):
Test resource path does not exist. Please set it correctly to run all the
unit and regression tests. Clone this github repo to get all the files:
https://github.com/CIBC-Internal/SCIRunTestData
CMake Warning at CMakeLists.txt:217 (FIND_PACKAGE):
Could not find a package configuration file named "ZlibConfig.cmake"
provided by package "Zlib".
Add the installation prefix of "Zlib" to CMAKE_PREFIX_PATH or set
"Zlib_DIR" to a directory containing one of the above files. If "Zlib"
provides a separate development package or SDK, be sure it has been
installed.
CMake Error at CMakeLists.txt:219 (MESSAGE):
Zlib library not found in Zlib_DIR-NOTFOUND
Additionally, I do have Zlib in my PATH var.
--- End Message ---
Archive powered by MHonArc 2.6.18.