cmake 2.8.12 correctly shows:
Boost version: 1.56.0
Found the following Boost libraries:
system
thread
log
log_setup
And the generated link.txt shows full, correct path to the .so files, but every Boost call is simply "In function...undefined reference to boost..." with no cxx11 or ABI or any other hints.
CMakeFiles/proj.dir/src/proj.cc.o: In function `proj::init()':
/code/proj/src/proj.cc:31: undefined reference to `boost::log::v2s_mt_posix::core::get()'
This is running on an old box, for example using libc-2.13.so on a 32bit processor. I compiled the boost libraries on the box yesterday and am trying to compile this on the box but am getting nowhere. I compiled cmake on the box as well.
Searching dozens of questions here has gotten me nowhere. Any suggestions on what is wrong? How to investigate the issue?
set(PROJ_NAME my-proj)
set(HEADERS
headers/proj.h
)
set(SOURCES
src/proj.cc
)
set(MAIN_FILE src/main.cc)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
add_executable (${PROJ_NAME} ${SOURCES}
${HEADERS} ${MAIN_FILE})
target_include_directories ( ${PROJ_NAME}
PUBLIC headers
PRIVATE .
PRIVATE /usr/local/lib/
)
set( Boost_LIBRARY_DIR /usr/local/lib )
find_package(Boost COMPONENTS system thread log log_setup REQUIRED)
link_directories(${Boost_LIBRARY_DIR})
target_link_libraries ( ${PROJ_NAME} -pthread ${Boost_LIBRARIES} )
I think that
set( Boost_LIBRARY_DIR /usr/local/lib )
is wrong and interferes badly with Find_Package. If you want to provide a hint, use e.g. BOOST_ROOT as documented:
BOOST_ROOT=~/custom/boost cmake .
Here's a fixed-up / simplified self-contained example that works:
File CMakeLists.txt
set(PROJ_NAME my-proj)
find_package(Boost 1.65.0 COMPONENTS system thread log log_setup REQUIRED)
set(HEADERS
headers/proj.h
)
set(SOURCES
src/proj.cc
)
set(MAIN_FILE src/main.cc)
if(COMMAND cmake_policy)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND cmake_policy)
add_executable (${PROJ_NAME} ${SOURCES}
${HEADERS} ${MAIN_FILE})
target_include_directories ( ${PROJ_NAME}
PUBLIC headers
PRIVATE .
PRIVATE /usr/local/lib/
)
link_directories(${Boost_LIBRARY_DIR})
target_link_libraries ( ${PROJ_NAME} -pthread ${Boost_LIBRARIES} )
File headers/proj.h
File src/main.cc
int main() {
}
File src/proj.cc
#include <boost/thread.hpp>
void foo() {
boost::thread_group tg;
tg.create_thread([]{});
tg.join_all();
}
Proof of the pudding:
cmake .
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Boost: /usr/include (found suitable version "1.65.1", minimum required is "1.65.0") found components: system thread log log_setup chrono date_time atomic filesystem regex
CMake Warning (dev) in CMakeLists.txt:
No cmake_minimum_required command is present. A line of code such as
cmake_minimum_required(VERSION 3.22)
should be added at the top of the file. The version specified may be lower
if you wish to support older CMake versions for this project. For more
information run "cmake --help-policy CMP0000".
This warning is for project developers. Use -Wno-dev to suppress it.
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/q
sehe / tmp q make
[ 66%] Building CXX object CMakeFiles/my-proj.dir/src/proj.o
[ 66%] Building CXX object CMakeFiles/my-proj.dir/src/main.o
[100%] Linking CXX executable my-proj
[100%] Built target my-proj
sehe / tmp q ldd my-proj
linux-vdso.so.1 (0x00007ffd917e4000)
libboost_system.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 (0x00007f40c25bd000)
libboost_thread.so.1.65.1 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 (0x00007f40c2398000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f40c2179000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f40c1d6c000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f40c1b54000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f40c1763000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f40c155b000)
/lib64/ld-linux-x86-64.so.2 (0x00007f40c29e7000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f40c11bd000)
NOTES
Note that if you use a too-recent boost then maybe the dependencies might be incorrect:
CMake Warning at /usr/share/cmake-3.22/Modules/FindBoost.cmake:1369 (message):
New Boost version may have incorrect or missing dependencies and imported
targets
Call Stack (most recent call first):
/usr/share/cmake-3.22/Modules/FindBoost.cmake:1492 (_Boost_COMPONENT_DEPENDENCIES)
/usr/share/cmake-3.22/Modules/FindBoost.cmake:2102 (_Boost_MISSING_DEPENDENCIES)
CMakeLists.txt:5 (find_package)
On my system, e.g. in order to use Boost 1.78 successfully, I have to add Boost System manually. Linker errors:
make
[ 33%] Building CXX object CMakeFiles/my-proj.dir/src/proj.o
[ 66%] Building CXX object CMakeFiles/my-proj.dir/src/main.o
[100%] Linking CXX executable my-proj
CMakeFiles/my-proj.dir/src/proj.o: In function `__static_initialization_and_destruction_0(int, int)':
proj.cc:(.text+0x6a1): undefined reference to `boost::system::generic_category()'
proj.cc:(.text+0x6ad): undefined reference to `boost::system::generic_category()'
proj.cc:(.text+0x6b9): undefined reference to `boost::system::system_category()'
CMakeFiles/my-proj.dir/src/proj.o: In function `boost::system::error_category::std_category::equivalent(int, std::error_condition const&) const':
proj.cc:(.text._ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition[_ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition]+0xb8): undefined reference to `boost::system::generic_category()'
proj.cc:(.text._ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition[_ZNK5boost6system14error_category12std_category10equivalentEiRKSt15error_condition]+0xf3): undefined reference to `boost::system::generic_category()'
CMakeFiles/my-proj.dir/src/proj.o: In function `boost::system::error_category::std_category::equivalent(std::error_code const&, int) const':
proj.cc:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0xb8): undefined reference to `boost::system::generic_category()'
proj.cc:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0xf3): undefined reference to `boost::system::generic_category()'
proj.cc:(.text._ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei[_ZNK5boost6system14error_category12std_category10equivalentERKSt10error_codei]+0x1d2): undefined reference to `boost::system::generic_category()'
CMakeFiles/my-proj.dir/src/proj.o:proj.cc:(.text._ZN5boost16thread_exceptionC2EiPKc[_ZN5boost16thread_exceptionC5EiPKc]+0x28): more undefined references to `boost::system::generic_category()' follow
collect2: error: ld returned 1 exit status
CMakeFiles/my-proj.dir/build.make:121: recipe for target 'my-proj' failed
make[2]: *** [my-proj] Error 1
CMakeFiles/Makefile2:82: recipe for target 'CMakeFiles/my-proj.dir/all' failed
make[1]: *** [CMakeFiles/my-proj.dir/all] Error 2
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
Fix:
target_link_libraries ( ${PROJ_NAME} boost_system )
I hope that it is not too late to drop my answer here.
TLDR: When Boost is installed using package managers such as Homebrew or macports often it is compiled using clang++. But on your project side, one might be using a different compiler, leading to undefined references in the linkage stage.
In order to use the compiler that you want to use in your project, you will have to use a version of Boost compiled with the same compiler. to achieve this you can customize Boost compilation on macos as follows:
In the Bootstrap stage use:
./bootstrap.sh --prefix=/usr/local/Cellar/boost_gcc --with-toolset=gcc --without-libraries=python,mpi
Install the headers-only part as follows:
./b2 headers
Customize the compiler to build the libraries by adding a file named user-config.jam with the following line in it:
using gcc : : /usr/local/bin/g++-11 ;
Compile and install the library as follows:
./b2 -d2 -j12 --layout=tagged-1.66 --user-config=user-config.jam install threading=multi,single link=shared,static
I hope that it helps.
I spent the past 3 days struggling to have Lua with Torch installed on my new Windows 10 laptop. Reading many stack overflow posts on the subject I came to think my best option was to follow very closely Siavash Gorji 's instructions - see: https://libraries.io/github/SiavashGorji/LuaJIT-Luarocks-Torch7.
LuaJIT and LuaRocks installed fine, but "luarocks install torch" command fails (fails when building torch7 using either VS2013 x64 or VS2017 x64).
First of, even if both LuaJIT and LuaRocks successfully build and run, here is what the first cmake did output:
(no source code here, just compiler outputs)
D:\luainstall-64\build>cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%LuaJIT-Luarocks-Torch7_ROOT%\install
-- The C compiler identification is MSVC 18.0.40629.0
-- The CXX compiler identification is MSVC 18.0.40629.0
-- Check for working C compiler: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe -- 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: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is MSVC
-- Found assembler: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Looking for sin in m
-- Looking for sin in m - not found
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
-- Performing Test LJ_TARGET_X64
-- Performing Test LJ_TARGET_X64 - Success
-- LuaJIT Target: x64
-- LuaJIT target x64
-- Performing Test LJ_ARCH_BITS_64
-- Performing Test LJ_ARCH_BITS_64 - Success
-- Performing Test LJ_HASJIT_1
-- Performing Test LJ_HASJIT_1 - Success
-- Performing Test LJ_HASFFI_1
-- Performing Test LJ_HASFFI_1 - Success
-- Performing Test LJ_DUALNUM_1
-- Performing Test LJ_DUALNUM_1 - Failed
-- Performing Test LJ_ARCH_HASFPU_1
-- Performing Test LJ_ARCH_HASFPU_1 - Success
-- Performing Test LJ_ABI_SOFTFP_1
-- Performing Test LJ_ABI_SOFTFP_1 - Failed
-- Looking for sin in m
-- Looking for sin in m - not found
-- Configuring done
-- Generating done
-- Build files have been written to: D:/luainstall-64/build
And last, when Torch7 build problem occurs, I have this (partial) output (focusing on things that may cause of the problem):
D:\luainstall-64\build>luarocks install torch
D:\luainstall-64\build>rem=rem --[[
Installing https://raw.githubusercontent.com/torch/rocks/master/torch-scm-1.rockspec...
Using https://raw.githubusercontent.com/torch/rocks/master/torch-scm-1.rockspec... switching to 'build' mode
Cloning into 'torch7'...
remote: Enumerating objects: 181, done.
remote: Counting objects: 100% (181/181), done.
remote: Compressing objects: 100% (174/174), done.
Receiving objects: 100% (181/181), 335.48 KiB | 1.00 MiB/s, done.ceiving objects: 98% (178/181)
Resolving deltas: 100% (8/8), done.
cmake -E make_directory build && cd build && cmake .. -DCMAKE_BUILD_TYPE=Release -DLUA=D:/luainstall-64/install/./luajit -DLUALIB=libluajit.lib -DLUA_BINDIR="D:/luainstall-64/install/." -DLUA_INCDIR="D:/luainstall-64/install/include" -DLUA_LIBDIR="D:/luainstall-64/install/." -DLUADIR="D:/luainstall-64/install/luarocks/torch/scm-1/lua" -DLIBDIR="D:/luainstall-64/install/luarocks/torch/scm-1/lib" -DCMAKE_INSTALL_PREFIX="D:/luainstall-64/install/luarocks/torch/scm-1" && nmake
D:\Users\docte\AppData\Local\Temp\luarocks_torch-scm-1-1820\torch7>if -E == -E (cmake.exe -E make_directory build ) else (cmake.exe -G "NMake Makefiles" -DWIN32=1 -E make_directory build )
D:\Users\docte\AppData\Local\Temp\luarocks_torch-scm-1-1820\torch7\build>if .. == -E (cmake.exe .. -DCMAKE_BUILD_TYPE=Release -DLUA=D:/luainstall-64/install/./luajit -DLUALIB=libluajit.lib -DLUA_BINDIR="D:/luainstall-64/install/." -DLUA_INCDIR="D:/luainstall-64/install/include" -DLUA_LIBDIR="D:/luainstall-64/install/." -DLUADIR="D:/luainstall-64/install/luarocks/torch/scm-1/lua" -DLIBDIR="D:/luainstall-64/install/luarocks/torch/scm-1/lib" -DCMAKE_INSTALL_PREFIX="D:/luainstall-64/install/luarocks/torch/scm-1" ) else (cmake.exe -G "NMake Makefiles" -DWIN32=1 .. -DCMAKE_BUILD_TYPE=Release -DLUA=D:/luainstall-64/install/./luajit -DLUALIB=libluajit.lib -DLUA_BINDIR="D:/luainstall-64/install/." -DLUA_INCDIR="D:/luainstall-64/install/include" -DLUA_LIBDIR="D:/luainstall-64/install/." -DLUADIR="D:/luainstall-64/install/luarocks/torch/scm-1/lua" -DLIBDIR="D:/luainstall-64/install/luarocks/torch/scm-1/lib" -DCMAKE_INSTALL_PREFIX="D:/luainstall-64/install/luarocks/torch/scm-1" )
-- The C compiler identification is MSVC 18.0.40629.0
-- The CXX compiler identification is MSVC 18.0.40629.0
-- Check for working C compiler: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe
-- Check for working C compiler: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe -- 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: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe
-- Check for working CXX compiler: D:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/amd64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenMP_C: -openmp (found version "2.0")
-- Found OpenMP_CXX: -openmp (found version "2.0")
-- Found OpenMP: TRUE (found version "2.0")
-- Compiling with OpenMP support
CMake Deprecation Warning at lib/TH/CMakeLists.txt:5 (CMAKE_POLICY):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Compiling with OpenMP support
-- Could not find hardware support for NEON on this machine.
-- No OMAP3 processor on this machine.
-- No OMAP4 processor on this machine.
-- Looking for cpuid.h
-- Looking for cpuid.h - not found
-- Performing Test NO_GCC_EBX_FPIC_BUG
-- Performing Test NO_GCC_EBX_FPIC_BUG - Failed
-- Performing Test C_HAS_SSE1_1
-- Performing Test C_HAS_SSE1_1 - Success
-- Performing Test C_HAS_SSE2_1
-- Performing Test C_HAS_SSE2_1 - Success
-- Performing Test C_HAS_SSE3_1
-- Performing Test C_HAS_SSE3_1 - Success
-- Performing Test C_HAS_SSE4_1_1
-- Performing Test C_HAS_SSE4_1_1 - Success
-- Performing Test C_HAS_SSE4_2_1
-- Performing Test C_HAS_SSE4_2_1 - Success
-- Performing Test C_HAS_AVX_1
-- Performing Test C_HAS_AVX_1 - Success
-- Performing Test C_HAS_AVX2_1
-- Performing Test C_HAS_AVX2_1 - Success
-- Performing Test CXX_HAS_SSE1_1
-- Performing Test CXX_HAS_SSE1_1 - Success
-- Performing Test CXX_HAS_SSE2_1
-- Performing Test CXX_HAS_SSE2_1 - Success
-- Performing Test CXX_HAS_SSE3_1
-- Performing Test CXX_HAS_SSE3_1 - Success
-- Performing Test CXX_HAS_SSE4_1_1
-- Performing Test CXX_HAS_SSE4_1_1 - Success
-- Performing Test CXX_HAS_SSE4_2_1
-- Performing Test CXX_HAS_SSE4_2_1 - Success
-- Performing Test CXX_HAS_AVX_1
-- Performing Test CXX_HAS_AVX_1 - Success
-- Performing Test CXX_HAS_AVX2_1
-- Performing Test CXX_HAS_AVX2_1 - Success
-- SSE2 Found
-- SSE3 Found
-- AVX Found
-- AVX2 Found
-- Performing Test HAS_C11_ATOMICS
-- Performing Test HAS_C11_ATOMICS - Failed
-- Performing Test HAS_MSC_ATOMICS
-- Performing Test HAS_MSC_ATOMICS - Success
-- Performing Test HAS_GCC_ATOMICS
-- Performing Test HAS_GCC_ATOMICS - Failed
-- TH_SO_VERSION: 0
-- Atomics: using MSVC intrinsics
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of void*
-- Check size of void* - done
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - libiomp5md - pthread]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - libiomp5md - pthread]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - libiomp5md - pthread]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - libiomp5md - pthread]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread]
-- Library mkl_intel: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- MKL library not found
-- Checking for [openblas]
-- Library openblas: BLAS_openblas_LIBRARY-NOTFOUND
-- Checking for [openblas - pthread]
-- Library openblas: BLAS_openblas_LIBRARY-NOTFOUND
-- Checking for [libopenblas]
-- Library libopenblas: BLAS_libopenblas_LIBRARY-NOTFOUND
-- Checking for [goto2 - gfortran]
-- Library goto2: BLAS_goto2_LIBRARY-NOTFOUND
-- Checking for [goto2 - gfortran - pthread]
-- Library goto2: BLAS_goto2_LIBRARY-NOTFOUND
-- Checking for [acml - gfortran]
-- Library acml: BLAS_acml_LIBRARY-NOTFOUND
-- Checking for [Accelerate]
-- Library Accelerate: BLAS_Accelerate_LIBRARY-NOTFOUND
-- Checking for [vecLib]
-- Library vecLib: BLAS_vecLib_LIBRARY-NOTFOUND
-- Checking for [ptf77blas - atlas - gfortran]
-- Library ptf77blas: BLAS_ptf77blas_LIBRARY-NOTFOUND
-- Checking for [blas]
-- Library blas: BLAS_blas_LIBRARY-NOTFOUND
-- Cannot find a library with BLAS API. Not using BLAS.
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - libiomp5md - pthread]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - libiomp5md - pthread]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_sequential - mkl_core]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_sequential - mkl_core]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - libiomp5md - pthread]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - libiomp5md - pthread]
-- Library mkl_intel: not found
-- Checking for [mkl_intel_lp64 - mkl_intel_thread - mkl_core - pthread]
-- Library mkl_intel_lp64: not found
-- Checking for [mkl_intel - mkl_intel_thread - mkl_core - pthread]
-- Library mkl_intel: not found
-- Checking for [mkl - guide - pthread - m]
-- Library mkl: not found
-- MKL library not found
-- Checking for [openblas]
-- Library openblas: BLAS_openblas_LIBRARY-NOTFOUND
-- Checking for [openblas - pthread]
-- Library openblas: BLAS_openblas_LIBRARY-NOTFOUND
-- Checking for [libopenblas]
-- Library libopenblas: BLAS_libopenblas_LIBRARY-NOTFOUND
-- Checking for [goto2 - gfortran]
-- Library goto2: BLAS_goto2_LIBRARY-NOTFOUND
-- Checking for [goto2 - gfortran - pthread]
-- Library goto2: BLAS_goto2_LIBRARY-NOTFOUND
-- Checking for [acml - gfortran]
-- Library acml: BLAS_acml_LIBRARY-NOTFOUND
-- Checking for [Accelerate]
-- Library Accelerate: BLAS_Accelerate_LIBRARY-NOTFOUND
-- Checking for [vecLib]
-- Library vecLib: BLAS_vecLib_LIBRARY-NOTFOUND
-- Checking for [ptf77blas - atlas - gfortran]
-- Library ptf77blas: BLAS_ptf77blas_LIBRARY-NOTFOUND
-- Checking for [blas]
-- Library blas: BLAS_blas_LIBRARY-NOTFOUND
-- Cannot find a library with BLAS API. Not using BLAS.
-- LAPACK requires BLAS
-- Cannot find a library with LAPACK API. Not using LAPACK.
-- Performing Test C_HAS_THREAD
-- Performing Test C_HAS_THREAD - Success
CMake Deprecation Warning at lib/luaT/CMakeLists.txt:3 (CMAKE_POLICY):
The OLD behavior for policy CMP0026 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
-- Configuring done
-- Generating done
-- Build files have been written to: D:/Users/docte/AppData/Local/Temp/luarocks_torch-scm-1-1820/torch7/build
Microsoft (R) Program Maintenance Utility Version 12.00.21005.1
Copyright (C) Microsoft Corporation. All rights reserved.
Scanning dependencies of target TH
[ 2%] Building C object lib/TH/CMakeFiles/TH.dir/THGeneral.c.obj
THGeneral.c
[ 5%] Building C object lib/TH/CMakeFiles/TH.dir/THHalf.c.obj
THHalf.c
[ 7%] Building C object lib/TH/CMakeFiles/TH.dir/THAllocator.c.obj
THAllocator.c
[ 10%] Building C object lib/TH/CMakeFiles/TH.dir/THSize.c.obj
THSize.c
[ 12%] Building C object lib/TH/CMakeFiles/TH.dir/THStorage.c.obj
THStorage.c
D:\Users\docte\AppData\Local\Temp\luarocks_torch-scm-1-1820\torch7\lib\TH\THStorage.c(18) : warning C4244: 'function' : conversion from 'const ptrdiff_t' to 'const long', possible loss of data
Now skipping some compiler warnings ...
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\generic/simd/simd.h(100) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\generic/simd/simd.h(101) : error C2085: 'cpuid' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\generic/simd/simd.h(101) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\generic/simd/simd.h(123) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\generic/simd/simd.h(124) : error C2085: 'detectHostSIMDExtensions' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\generic/simd/simd.h(124) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(4) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(4) : error C2085: 'TH_sigmoid' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(4) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(8) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(8) : error C2085: 'TH_frac' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(8) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(12) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(12) : error C2085: 'TH_rsqrt' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(12) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(16) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(16) : error C2085: 'TH_lerp' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(16) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(20) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(20) : error C2085: 'TH_sigmoidf' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(20) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(24) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(24) : error C2085: 'TH_fracf' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(24) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(28) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(28) : error C2085: 'TH_rsqrtf' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(28) : error C2143: syntax error : missing ';' before '{'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(32) : error C2054: expected '(' to follow 'inline'
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(32) : error C2085: 'TH_lerpf' : not in formal parameter list
d:\users\docte\appdata\local\temp\luarocks_torch-scm-1-1820\torch7\lib\th\THMath.h(32) : error C2143: syntax error : missing ';' before '{'
skipping some warnings ...
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64\cl.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
Error: Build error: Failed building.
D:\luainstall-64\build>
I know Torch7 is not officially supported on Windows yet, but it would be a great help for the community if we had a successful solution. I am definitely available this full week to succeed, but I feel I need a kick or two with the help of some Torch7 dependencies expert that can help me focusing on what is mandatory I do at this stage.
If we make it work under Windows 10, either with MSVC or MinGW it will be a success for the Lua Windows Community!!!
OK Microsoft Windows 10 Users. I solved this amazing installation/configuration/re-compilation puzzle using VS2013 x64 (one could most likely succeed as well using VS2017 and maybe even VS2019). The solution is based on Siavash Gorji 's instructions - see: https://libraries.io/github/SiavashGorji/LuaJIT-Luarocks-Torch7 that I followed step by step while keeping an exact and detailed log of everything I had to do.
Today, I must keep going at installing the optional, but important for execution speed, Installing (recompiling) the NVIDIA CUDA software layers (cutorch, cunn, cunnx and cudnn Modules). And I will post in here, these additional steps later today.
-1) Today, I did installed the full Intel MKL Library for my VS2013 and VS2017 installs
0) Now, after a reboot, this is an attempt to successfully install LuaJIT-Luarocks-Torch7 using VS2013 x64 Native Tools Command Prompt
0.5) To have the Intel MKL Library detected this time around, set environment variables for this VS2013 x64 Native Tools Command Prompt
as specified by https://software.intel.com/en-us/mkl-windows-developer-guide-setting-environment-variables
and Intel MKL Library installation notes at https://software.intel.com/en-us/mkl/choose-download/windows
cd "D:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019\windows\mkl\bin"
d:
mklvars.bat intel64
1) Then, we re-build LuaJIT-Luarocks (hoping this time it sees the Intel MKL Library):
cd D:\luainstall-64\build
d:
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%LuaJIT-Luarocks-Torch7_ROOT%\install
nmake
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%LuaJIT-Luarocks-Torch7_ROOT%\install -P cmake_install.cmake
2) the rocks cwrap and paths are installed, so keep attempting to install luarocks install torch
luarocks list
luarocks install torch
but, "luarocks install torch" returns error, starting with "inline" not being defined,
inline is a c99 keyword and c99 is not yet (fully) supported with MSVC (ref. http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx).
we can define:
-Dinline=__inline
to do so:
cd D:\luainstall-64\install\luarocks
d:
luarocks download torch
edit rockspec file D:\luainstall-64\install\luarocks\torch-scm-1.rockspec
add -Dinline=__inline (let's say after "cmake -E make_directory build && cd build && cmake .. " and before "-DCMAKE_BUILD_TYPE=Release -DLUA=$(LUA) -DLUALIB=$(LUALIB) -DLUA_BINDIR="$(LUA_BINDIR)" -DLUA_INCDIR="$(LUA_INCDIR)" -DLUA_LIBDIR="$(LUA_LIBDIR)" -DLUADIR="$(LUADIR)" -DLIBDIR="$(LIBDIR)" -DCMAKE_INSTALL_PREFIX="$(PREFIX)" && $(MAKE)")
luarocks unpack torch-scm-1.rockspec
cd torch-scm-1\torch7
edit CMakeLists.txt
so the section "Flags when using MSVC" looks like this:
# Flags
# When using MSVC
IF(MSVC)
# we want to respect the standard, and we are bored of those **** .
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE=1)
# spi, begin
# "luarocks install torch" returns error, starting with "inline" not being defined,
# inline is a c99 keyword and c99 is not yet (fully) supported with MSVC (ref. http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx).
ADD_DEFINITIONS(-Dinline=__inline)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FORCE")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /FORCE")
# spi, end
ENDIF(MSVC)
now, ready to build using:
luarocks make ..\..\torch-scm-1.rockspec
And "luarocks torch install" works, at last!!!
To test the torch installation, we can create and display a 2x3x4 randomly initialized tensor on a regular Command Prompt by:
luajit
require "torch"
print(torch.Tensor(2,3,4))
It works!!!
Finnaly, set Torch_DIR as an Environment Variable to the LuaJIT-Luarocks-Torch7_ROOT%\share\cmake\torch directory:
setx Torch_DIR %LuaJIT-Luarocks-Torch7_ROOT%\share\cmake\torch
(for me, I edit the system environment variables from the controlpanel, adding Torch_DIR D:\luainstall-64\share\cmake\torch)
So, I must therefore close the VS2013 x64 Native Tools Command Prompt
and re-open a new VS2013 x64 Native Tools Command Prompt again
cd "D:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019\windows\mkl\bin"
d:
mklvars.bat intel64
Now, Installing Torch Modules:
When you install torch on Unix environments, it will automatically installs "lots of nice goodies". In the following section, we try to install them (i.e. most of them) one by one using luarocks installer. Try to install these in the same order presented here. To install some of the lua/torch modules that contain C code on Windows, we need to make some changes to them (since we are basically porting them from Linux). You can find all such editted modules inside the extra folder in "%LuaJIT-Luarocks-Torch7_ROOT%. To install these, we will use luarocks local installation capabality (i.e. using "luarocks make" instead of "luarocks install"). As you can see below, all we need to do is to cd the NTCP to the main directory of each module, and run "luarocks make path-to-module-rockspec-file".
luarocks install luafilesystem
luarocks install penlight
cd %LuaJIT-Luarocks-Torch7_ROOT%\extra\lua-cjson
(for me, cd D:\luainstall-64\extra\lua-cjson)
luarocks make lua-cjson-2.1devel-1.rockspec
cd %LuaJIT-Luarocks-Torch7_ROOT%\extra\luaffifb
(for me, cd D:\luainstall-64\extra\luaffifb)
luarocks make luaffi-scm-1.rockspec
luarocks install sundown
luarocks install dok
cd %LuaJIT-Luarocks-Torch7_ROOT%\extra\sys
(for me, cd D:\luainstall-64\extra\sys)
luarocks make sys-1.1-0.rockspec
luarocks install xlua
but "luarocks install nn" does not go through, need to luarocks download, luarocks unpack and luarocks make:
cd D:\luainstall-64\install\luarocks
d:
luarocks download nn
edit rockspec file D:\luainstall-64\install\luarocks\nn-scm-1.rockspec
add -Dinline=__inline
luarocks unpack nn-scm-1.rockspec
cd nn-scm-1\nn
edit CMakeLists.txt
so the section "Flags when using MSVC" looks like this:
# Flags
# When using MSVC
IF(MSVC)
# we want to respect the standard, and we are bored of those **** .
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE=1)
# spi, begin
# "luarocks install nn" returns error, starting with "inline" not being defined,
# inline is a c99 keyword and c99 is not yet (fully) supported with MSVC (ref. http://msdn.microsoft.com/en-us/library/z8y1yy88.aspx).
ADD_DEFINITIONS(-Dinline=__inline)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FORCE")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /FORCE")
# spi, end
ENDIF(MSVC)
now, ready to build using:
rename D:\luainstall-64\install\luarocks\nn nn-backup
luarocks make ..\..\nn-scm-1.rockspec
failing to build nn, because of
d:\luainstall-64\install\luarocks\nn-scm-1\nn\lib\thnn\generic/FeatureLPPooling.c(214) : error C2143: syntax error : missing ';' before 'type'
unsigned type not supported in openmp 2.0 (which is the version msvc 2013 supports),
so, for 2 blocks of code in FeatureLPPooling.c, I replaced the type size_t by long (within the 2 pragma omp parallel for blocks of code)
also, not declaring any counter variables within for statement (within the pragma omp parallel for here below,
moving counter variables declaration before each for loop
retrying to to build nn
cd D:\luainstall-64\install\luarocks\nn-scm-1\nn
d:
luarocks make ..\..\nn-scm-1.rockspec
and the build works!!!
luarocks install graph
luarocks install nngraph
but "luarocks install image" does not go through
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
so, see https://devblogs.microsoft.com/cppblog/vcpkg-a-tool-to-acquire-and-build-c-open-source-libraries-on-windows/
Clone from GitHub: git clone https://github.com/Microsoft/vcpkg
Run the bootstrap script in the vcpkg folder:
D:\vcpkg> .\bootstrap-vcpkg.bat
d:\vcpkg>vcpkg integrate install
Applied user-wide integration for this vcpkg root.
d:\vcpkg>vcpkg install openjpeg:x64-windows
d:\vcpkg>vcpkg install zlib:x64-windows
zlib install did not succeed
vcpkg update
retry zlib install
d:\vcpkg>vcpkg install zlib:x64-windows
zlib install succeeded
d:\vcpkg>vcpkg install libpng:x64-windows
libpng install did not succeed
retry
d:\vcpkg>vcpkg install libpng:x64-windows
libpng install succeeded
now, retry installing "luarocks install image"
luarocks install image
it does not go through
-- Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)
-- Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
-- Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)
set the 6 following environment variables:
JPEG_LIBRARY D:\vcpkg\packages\openjpeg_x64-windows\lib
JPEG_INCLUDE_DIR D:\vcpkg\packages\openjpeg_x64-windows\include
ZLIB_LIBRARY D:\vcpkg\packages\zlib_x64-windows\lib
ZLIB_INCLUDE_DIR D:\vcpkg\packages\zlib_x64-windows\include
PNG_LIBRARY D:\vcpkg\packages\libpng_x64-windows\lib
PNG_PNG_INCLUDE_DIR D:\vcpkg\packages\libpng_x64-windows\include
(for me, I edit the system environment variables from the controlpanel)
So, I must therefore close the VS2013 x64 Native Tools Command Prompt
and re-open a new VS2013 x64 Native Tools Command Prompt again
cd "D:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2019\windows\mkl\bin"
d:
mklvars.bat intel64
cd D:\luainstall-64\install\luarocks
d:
now, retry installing "luarocks install image"
luarocks install image
(2019july25, 12h56am) "luarocks install image" still not seeing jpeg, zlib and png libraries
so, "luarocks install image" does not go through, need to luarocks download, luarocks unpack and luarocks make:
cd D:\luainstall-64\install\luarocks
d:
luarocks download image
edit rockspec file D:\luainstall-64\install\luarocks\image-1.1.alpha-0.rockspec
add this define to cmake command:
"-DCMAKE_TOOLCHAIN_FILE=d:/vcpkg/scripts/buildsystems/vcpkg.cmake"
i.e. cmake -DCMAKE_TOOLCHAIN_FILE=d:/vcpkg/scripts/buildsystems/vcpkg.cmake
add also -Dinline=__inline to this cmake command
also add -DJPEG_LIBRARY=D:/vcpkg/packages/openjpeg_x64-windows/lib
along with -DJPEG_INCLUDE_DIR=D:/vcpkg/packages/openjpeg_x64-windows/include
luarocks unpack image-1.1.alpha-0.rockspec
cd image-1.1.alpha-0/image
edit CMakeLists.txt
at the top, after the FIND_PACKAGE statements, add this line
ADD_DEFINITIONS(-Dinline=__inline)
now, ready to build using:
rename D:\luainstall-64\install\luarocks\image image-backup
luarocks make ..\..\image-1.1.alpha-0.rockspec
this time, build success, but it still did not find the jpeg library
so, at the top, after the FIND_PACKAGE statements and the previous
ADD_DEFINITIONS(-Dinline=__inline) statement ...
add this line
ADD_DEFINITIONS(-DJPEG_LIBRARY="D:/vcpkg/packages/openjpeg_x64-windows/lib")
add this line
ADD_DEFINITIONS(-DJPEG_INCLUDE_DIR="D:/vcpkg/packages/openjpeg_x64-windows/include")
now, ready to build again using:
luarocks make ..\..\image-1.1.alpha-0.rockspec
ok, this time the code is looking for the header jpeglib.h which is not in openjpeg library
at the time of this document writing, microsoft vcpkg can't install libjpeg nor will it successfully install libjpeg-turbo
so, I directly download libjpeg-turbo from https://sourceforge.net/projects/libjpeg-turbo/files/2.0.0/libjpeg-turbo-2.0.0-vc64.exe/download
and install it and revise (edit again) my libjpeg related environment variables (using controlpanel environment variable editor)
JPEG_LIBRARY D:\libjpeg-turbo64\lib
JPEG_INCLUDE_DIR D:\libjpeg-turbo64\include
once again, let's edit rockspec file
edit D:\luainstall-64\install\luarocks\image-1.1.alpha-0.rockspec
and revise (change) the libjpeg related defines proving the new path to libjpeg-turbo's folders with forward slashes for safety
-DJPEG_LIBRARY=D:/libjpeg-turbo64/lib/jpeg.lib
-DJPEG_LIBRARY2=D:/libjpeg-turbo64/lib/turbojpeg.lib
-DJPEG_INCLUDE_DIR=D:/libjpeg-turbo64/include
now, let's do again
cd D:\luainstall-64\install\luarocks
d:
luarocks unpack image-1.1.alpha-0.rockspec
cd image-1.1.alpha-0/image
edit CMakeLists.txt
at the top, after the FIND_PACKAGE statements, add this line
ADD_DEFINITIONS(-Dinline=__inline)
add this line
ADD_DEFINITIONS(-DJPEG_LIBRARY="D:/libjpeg-turbo64/lib/jpeg.lib")
add this line
ADD_DEFINITIONS(-DJPEG_LIBRARY2="D:/libjpeg-turbo64/lib/turbojpeg.lib")
add this line
ADD_DEFINITIONS(-DJPEG_INCLUDE_DIR="D:/libjpeg-turbo64/include")
and in the "if (JPEG_FOUND)" block, replace the 2 lines here below
replace
SET(CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARY}")
with
SET(CMAKE_REQUIRED_LIBRARIES "${JPEG_LIBRARY} ${JPEG_LIBRARY2}")
and replace
TARGET_LINK_LIBRARIES(jpeg luaT TH ${JPEG_LIBRARIES})
with
TARGET_LINK_LIBRARIES(jpeg luaT TH ${JPEG_LIBRARIES} ${JPEG_LIBRARY} ${JPEG_LIBRARY2})
now, ready to build again using:
luarocks make ..\..\image-1.1.alpha-0.rockspec
cd D:\luainstall-64\install\luarocks
d:
luarocks install optim
luarocks install gnuplot
luarocks install env
cd %LuaJIT-Luarocks-Torch7_ROOT%\extra\nnx
luarocks make nnx-0.1-1.rockspec
luarocks install graphicsmagick
luarocks install argcheck
luarocks install fftw3
cd %LuaJIT-Luarocks-Torch7_ROOT%\extra\torch-signal
luarocks make ./rocks/signal-scm-1.rockspec
luarocks install class
luarocks install rational
luarocks install cairo
cd %LuaJIT-Luarocks-Torch7_ROOT%\extra\luasocket
luarocks make ./rockspec/luasocket-3.0rc2-1.rockspec
OK, success so far
First part of the complete solution found!
If some of you want to reproduce this, see the reference section here below to see how I got to today's point.
Cheers,
Steph
for reference: (the day before, I started doing these steps)
1) Installation (windows 64 bit)
I choose to install in:
D:\luainstall-64
Set environment variables:
LuaJIT-Luarocks-Torch7_ROOT D:\luainstall-64
On Windows - use command prompt with appropritate environment (I used VS2013 x64 Native Tools Command Prompt)
cd %LuaJIT-Luarocks-Torch7_ROOT%\..
git clone https://github.com/SiavashGorji/LuaJIT-Luarocks-Torch7.git
cd %LuaJIT-Luarocks-Torch7_ROOT%
mkdir build
cd build
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%LuaJIT-Luarocks-Torch7_ROOT%\install
nmake
cmake .. -G "NMake Makefiles" -DCMAKE_INSTALL_PREFIX=%LuaJIT-Luarocks-Torch7_ROOT%\install -P cmake_install.cmake
setx path "%LuaJIT-Luarocks-Torch7_ROOT%\install;%path%"
D:\luainstall-64\install
setx LUA_PATH .\?.lua;C:\Programs\LuaJIT-Luarocks-Torch7\install\lua\?.lua;C:\Programs\LuaJIT-Luarocks-Torch7\install\lua\?\init.lua;
set LUA_PATH .\?.lua;D:\luainstall-64\install\lua\?.lua;D:\luainstall-64\install\lua\?\init.lua;
setx LUA_CPATH .\?.dll;C:\Programs\LuaJIT-Luarocks-Torch7\install\?.dll;C:\Programs\LuaJIT-Luarocks-Torch7\install\loadall.dll
set LUA_CPATH .\?.dll;D:\luainstall-64\install\?.dll;D:\luainstall-64\install\loadall.dll
setx LUA_DEV %LuaJIT-Luarocks-Torch7_ROOT%\install
IMPORTANT NOTE:
Note that in the installation directory, there is a cmake.cmd which automatically appends any cmake commands (which are called by luarocks) with the -G "NMake Makefiles" flag. In order for this to work, you should make sure that the installation directory precedes cmake installation directory.
So, I did put D:\luainstall-64\install first in the system path (way before the path for cmake).
2) Torch7 (windows 64 bit)
On Windows - use command prompt with appropriate environment (I used VS2013 x64 Native Tools Command Prompt)
luarocks install cwrap
luarocks install paths
luarocks install torch
but got an error at some point during luarocks install torch:
[ 61%] Generating TensorMath.c
NMAKE : fatal error U1077: 'D:\luainstall-64\install\luajit.EXE' : return code '0xc0000005'
Stop.
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
Error: Build error: Failed building.
I am building igatools logstream error, try to solve the problem through http://logstream.sourceforge.net/ download loglog, but logtream installation failed, has been studied for two weeks, still unresolved,
Error:
[ 47%] Building CXX object CMakeFiles/igatools.dir/source/base/tensor.cpp.o
In file included from
/usr/local/src/igatools/include/igatools/base/tensor.h:26:0,
from /usr/local/src/igatools/source/base/tensor.cpp:21:
/usr/local/src/igatools/include/igatools/base/logstream.h: In member
function ‘iga::LogStream& iga::LogStream::operator<<(double)’:
/usr/local/src/igatools/include/igatools/base/logstream.h:667:14: error:
‘numeric_limits’ is not a member of ‘std’
if (!(t <= std::numeric_limits<double>::max()))
^~~
/usr/local/src/igatools/include/igatools/base/logstream.h:667:34: error:
expected primary-expression before ‘double’
if (!(t <= std::numeric_limits<double>::max()))
^~~~~~
/usr/local/src/igatools/include/igatools/base/logstream.h:667:34: error:
expected ‘)’ before ‘double’
/usr/local/src/igatools/include/igatools/base/logstream.h:668:16: error:
expected ‘)’ before ‘;’ token
stream << t;
^
make[2]: *** [CMakeFiles/igatools.dir/source/base/tensor.cpp.o] Error 1
make[1]: *** [CMakeFiles/igatools.dir/all] Error 2
make: *** [all] Error 2
This is my system environment:
System:CentOS 6.7 x86_64
Cmake:3.1.0
Doxygen:1.8.1
Boost:1..64.0
Trilinos:11.6.1
GCC:6.2.0 (gcc,g++,gfortran)
Igatools:git clone https://github.com/igatoolsProject/igatools.git
Igatools install:
Before the installation boost1.54.0 boost report error, and finally in the boost1.54.0 on the basis of the same method used to compile and install boost1.64.0, to solve the problem of boost error, although it still shows boost1.54.0, but should not affect if Maybe, I think it is not difficult to solve
[root#localhost build_igatools]# cmake ${IGATOOLS_SOURCE} \
> -DTrilinos_PREFIX=${TRILINOS_PREFIX} \
> -DCMAKE_INSTALL_PREFIX=${IGATOOLS_PREFIX} \
> -DCMAKE_CXX_COMPILER=/usr/local/bin/g++
-- The CXX compiler identification is GNU 6.2.0
-- The C compiler identification is GNU 6.2.0
-- Check for working CXX compiler: /usr/local/bin/g++
-- Check for working CXX compiler: /usr/local/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/local/bin/gcc
-- Check for working C compiler: /usr/local/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found sed: /bin/sed.
-- Found PythonInterp: /usr/bin/python (found version "2.6.6")
-- Found Doxygen: /usr/local/bin/doxygen (found suitable version "1.8.1",
minimum required is "1.8.1")
-- TRILINOS support is enabled.
-- NURBS support is enabled.
-- Quadruple precision support (EXPERIMENTAL) is not enabled.
-- Multipatch features (EXPERIMENTAL) are not enabled.
-- Hierarchical splines support (EXPERIMENTAL) is not enabled.
-- Mesh refinement support (EXPERIMENTAL) is enabled.
-- Serialization support (EXPERIMENTAL) is not enabled.
-- Paraview plugin building (EXPERIMENTAL) is not enabled.
-- XML I/O support (EXPERIMENTAL) is not enabled.
-- VTK support (EXPERIMENTAL) is not enabled.
-- CGAL support (EXPERIMENTAL) is not enabled.
-- Boost version: 1.54.0
-- Found Trilinos: version 11.6.1.
-- IGATOOLS build type: DEBUG
Configuring instantiations
-- Generating physical basis table.
Default instantiation table was created.
Configuring Tutorial
-- Configured: example_06
-- Configured: example_02
-- Configured: example_07
-- Configured: example_05
-- Configured: example_08
-- Configured: example_01
-- Configured: example_04
-- Configured: example_09
-- Configured: example_03
Configuring unit tests
******************************************************************
**
** [1] To compile and install the library run:
** make install
**
** [2] To use the library it should be made visible to the loader.
** Add the following line to your ~/.bash_rc
** export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/lib
**
** [3] To generate and install the online documentation run:
** make doc
**
******************************************************************
-- Configuring done
-- Generating done
-- Build files have been written to: /usr/local/src/build_igatools
[root#localhost build_igatools]#
When i make install on the error, suggesting that logtream error message, I tried to install logtream package, but failed
[root#localhost build_igatools]# make install
[ 0%] Generating file io/writer.inst
[ 0%] Generating file base/tensor.inst
[ 2%] Generating file base/quadrature_lib.inst
...
...
...
[ 43%] Generating file functions/ig_function_handler.inst
[ 43%] Generating file functions/sub_grid_function_element.inst
[ 45%] Generating file functions/grid_function_handler.inst
[ 45%] Generating file functions/function_element.inst
[ 45%] Generating file functions/sub_grid_function.inst
Scanning dependencies of target igatools
[ 47%] Building CXX object CMakeFiles/igatools.dir/source/base/tensor.cpp.o
In file included from
/usr/local/src/igatools/include/igatools/base/tensor.h:26:0,
from /usr/local/src/igatools/source/base/tensor.cpp:21:
/usr/local/src/igatools/include/igatools/base/logstream.h: In member
function ‘iga::LogStream& iga::LogStream::operator<<(double)’:
/usr/local/src/igatools/include/igatools/base/logstream.h:667:14: error:
‘numeric_limits’ is not a member of ‘std’
if (!(t <= std::numeric_limits<double>::max()))
^~~
/usr/local/src/igatools/include/igatools/base/logstream.h:667:34: error:
expected primary-expression before ‘double’
if (!(t <= std::numeric_limits<double>::max()))
^~~~~~
/usr/local/src/igatools/include/igatools/base/logstream.h:667:34: error:
expected ‘)’ before ‘double’
/usr/local/src/igatools/include/igatools/base/logstream.h:668:16: error:
expected ‘)’ before ‘;’ token
stream << t;
^
make[2]: *** [CMakeFiles/igatools.dir/source/base/tensor.cpp.o] Error 1
make[1]: *** [CMakeFiles/igatools.dir/all] Error 2
make: *** [all] Error 2
Oh,my god ,help me!
I'm trying to compile openwsman 2.4.12 (and 2.4.10) on a CentOS 7 system and am running into the error below. I've also duplicated the error on a RHEL 7 system as well and don't know what to make of it. It seems to be erroring on rdoc and trying to reference version 2.2, but I'm running 4.2.0 of rdoc. I am however running ruby 2.2.0, so not sure it its thinking it should be looking for 2.2 of rdoc because of the version of ruby I have, though both are the latest versions available. Any ideas would be greatly appreciated. It is worth mentioning that this worked on a RHEL 6.5 box.
Creating rdoc documentation .../bin/sh: ./rdoc2.2: No such file or directory
make[2]: *** [bindings/ruby/html] Error 127
make[1]: *** [bindings/ruby/CMakeFiles/ruby_gem.dir/all] Error 2
make: *** [all] Error 2
These are the results of the cmake command I ran.
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /bin/cc
-- Check for working C compiler: /bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /bin/c++
-- Check for working CXX compiler: /bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Version 2.4.12
-- Package Version "2.4"
-- Plugin API Version "2.2"
-- Package build timestamp 201501122347
-- Building for x86_64
-- Libraries will be installed in /usr/lib64
-- Configuration will be installed in /etc/openwsman
-- building PAM authentication
-- Found OpenSSL: /usr/lib64/libssl.so;/usr/lib64/libcrypto.so (found version "1.0.1e")
-- Building Ruby bindings
-- Building Python bindings
-- Found PythonLibs: /usr/lib64/libpython2.7.so (found version "2.7.5")
-- Found PythonInterp: /bin/python (found version "2.7.5")
-- Found PythonLibs...
-- Building Python...
-- Found Perl: /bin/perl (found version "5.16.3")
-- Building Perl bindings
-- Found Java: /bin/java (found version "1.7.0.71")
-- Found JNI: /usr/lib/jvm/jre/lib/amd64/libjawt.so
-- Building Java bindings
-- Found SWIG: /usr/local/bin/swig (found version "3.0.3")
-- SWIG 3.0.3 found at /usr/local/bin/swig
-- Python executable: /bin/python
-- Python lib dir: /usr/lib64/python2.7/site-packages
-- Ruby executable: /usr/local/bin/ruby
-- Ruby version: 2.2.0
-- Ruby dir: /usr/local/lib/ruby/vendor_ruby/2.2.0
-- Ruby arch dir: /usr/local/lib/ruby/vendor_ruby/2.2.0/x86_64-linux
-- Ruby include path: /usr/local/include/ruby-2.2.0
-- Java compiler: /bin/javac
-- Java runtime: /bin/java
-- Java archiver: /bin/jar
-- Java archive name: openwsman-x86_64-2.4.12.jar
-- Perl executable: /bin/perl
-- Perl core dir: /usr/lib64/perl5/CORE
-- Perl vendor arch dir: /usr/lib64/perl5/vendor_perl
-- Perl vendor lib dir: /usr/share/perl5/vendor_perl
-- Found CURL: /usr/lib64/libcurl.so (found version "7.29.0")
-- Found LibXml2: /usr/lib64/libxml2.so (found version "2.9.1")
-- Looking for include file pthread.h
-- Looking for include file pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Looking for crypt.h
-- Looking for crypt.h - found
-- Looking for ctype.h
-- Looking for ctype.h - found
-- Looking for CUnit/Basic.h
-- Looking for CUnit/Basic.h - not found
-- Looking for dirent.h
-- Looking for dirent.h - found
-- Looking for dlfcn.h
-- Looking for dlfcn.h - found
-- Looking for ifaddrs.h
-- Looking for ifaddrs.h - found
-- Looking for inttypes.h
-- Looking for inttypes.h - found
-- Looking for memory.h
-- Looking for memory.h - found
-- Looking for netinet/in.h
-- Looking for netinet/in.h - found
-- Looking for net/if_dl.h
-- Looking for net/if_dl.h - not found
-- Looking for net/if.h
-- Looking for net/if.h - found
-- Looking for pam/pam_appl.h
-- Looking for pam/pam_appl.h - not found
-- Looking for pam/pam_misc.h
-- Looking for pam/pam_misc.h - not found
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for security/pam_appl.h
-- Looking for security/pam_appl.h - found
-- Looking for security/pam_misc.h
-- Looking for security/pam_misc.h - found
-- Looking for stdarg.h
-- Looking for stdarg.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stdlib.h
-- Looking for stdlib.h - found
-- Looking for strings.h
-- Looking for strings.h - found
-- Looking for string.h
-- Looking for string.h - found
-- Looking for sys/ioctl.h
-- Looking for sys/ioctl.h - found
-- Looking for sys/resource.h
-- Looking for sys/resource.h - found
-- Looking for sys/select.h
-- Looking for sys/select.h - found
-- Looking for sys/sendfile.h
-- Looking for sys/sendfile.h - found
-- Looking for sys/signal.h
-- Looking for sys/signal.h - found
-- Looking for sys/socket.h
-- Looking for sys/socket.h - found
-- Looking for sys/sockio.h
-- Looking for sys/sockio.h - not found
-- Looking for sys/stat.h
-- Looking for sys/stat.h - found
-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for vararg.h
-- Looking for vararg.h - not found
-- Looking for sys/time.h
-- Looking for sys/time.h - found
-- Looking for getifaddrs
-- Looking for getifaddrs - found
-- Looking for alloca
-- Looking for alloca - not found
-- Looking for alloca.h
-- Looking for alloca.h - found
-- Looking for bcopy
-- Looking for bcopy - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of in_addr_t
-- Check size of in_addr_t - failed
-- Check type in_addr_t as HAVE_IN_ADDR_T
-- Check type in_port_t as HAVE_IN_PORT_T
-- Check type sa_family_t as HAVE_SA_FAMILY_T
-- Check type int as HAVE_INT
-- Check type long as HAVE_LONG
-- Check type long long as HAVE_LONG_LONG
-- Check type short as HAVE_SHORT
-- Performing Test HAVE_SA_LEN
-- Performing Test HAVE_SA_LEN - Failed
-- Performing Test HAVE_IPV6
-- Performing Test HAVE_IPV6 - Success
-- SSL_LIB is at >libssl.so.1.0.1e<
-- Package file openwsman-2.4.12
-- Configuring done
-- Generating done
-- Build files have been written to: /root/openwsman-2.4.12/build
And these are the results of the make command I ran afterwards.
Scanning dependencies of target wsman_curl_client_transport
[ 1%] Building C object src/lib/CMakeFiles/wsman_curl_client_transport.dir/wsman-client-transport.o
[ 2%] Building C object src/lib/CMakeFiles/wsman_curl_client_transport.dir/wsman-curl-client-transport.o
Linking C shared library libwsman_curl_client_transport.so
[ 2%] Built target wsman_curl_client_transport
Scanning dependencies of target wsman_client
[ 2%] Building C object src/lib/CMakeFiles/wsman_client.dir/wsman-client.o
Linking C shared library libwsman_client.so
[ 2%] Built target wsman_client
Scanning dependencies of target wsman
[ 2%] Building C object src/lib/CMakeFiles/wsman.dir/u/buf.o
[ 3%] Building C object src/lib/CMakeFiles/wsman.dir/u/log.o
[ 4%] Building C object src/lib/CMakeFiles/wsman.dir/u/memory.o
[ 5%] Building C object src/lib/CMakeFiles/wsman.dir/u/misc.o
[ 6%] Building C object src/lib/CMakeFiles/wsman.dir/u/uri.o
[ 7%] Building C object src/lib/CMakeFiles/wsman.dir/u/uuid.o
[ 8%] Building C object src/lib/CMakeFiles/wsman.dir/u/lock.o
[ 9%] Building C object src/lib/CMakeFiles/wsman.dir/u/md5.o
[ 10%] Building C object src/lib/CMakeFiles/wsman.dir/u/strings.o
[ 10%] Building C object src/lib/CMakeFiles/wsman.dir/u/list.o
[ 11%] Building C object src/lib/CMakeFiles/wsman.dir/u/hash.o
[ 12%] Building C object src/lib/CMakeFiles/wsman.dir/u/base64.o
[ 13%] Building C object src/lib/CMakeFiles/wsman.dir/u/iniparser.o
[ 14%] Building C object src/lib/CMakeFiles/wsman.dir/u/debug.o
[ 15%] Building C object src/lib/CMakeFiles/wsman.dir/u/uerr.o
[ 16%] Building C object src/lib/CMakeFiles/wsman.dir/u/uoption.o
[ 17%] Building C object src/lib/CMakeFiles/wsman.dir/u/gettimeofday.o
[ 18%] Building C object src/lib/CMakeFiles/wsman.dir/u/syslog.o
[ 18%] Building C object src/lib/CMakeFiles/wsman.dir/u/pthreadx_win32.o
[ 19%] Building C object src/lib/CMakeFiles/wsman.dir/u/os.o
[ 20%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-libxml2-binding.o
[ 21%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-xml.o
[ 22%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-epr.o
[ 23%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-filter.o
[ 24%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-dispatcher.o
[ 25%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-soap.o
[ 26%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-faults.o
[ 27%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-xml-serialize.o
[ 27%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-soap-envelope.o
[ 28%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-debug.o
[ 29%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-soap-message.o
[ 30%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-subscription-repository.o
[ 31%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-event-pool.o
[ 32%] Building C object src/lib/CMakeFiles/wsman.dir/wsman-cimindication-processor.o
Linking C shared library libwsman.so
[ 32%] Built target wsman
[ 33%] Generating openwsman_wrap.c
Creating wrapper code for Python ...Done.
Scanning dependencies of target pywsman
[ 34%] Building C object bindings/python/CMakeFiles/pywsman.dir/openwsman_wrap.o
[ 34%] Building C object bindings/python/CMakeFiles/pywsman.dir//openwsman.o
Linking C shared library _pywsman.so
[ 34%] Built target pywsman
[ 35%] Generating openwsman_wrap.c
Creating wrapper code for Ruby...Done.
Scanning dependencies of target rbwsman
[ 36%] Building C object bindings/ruby/CMakeFiles/rbwsman.dir/openwsman_wrap.o
[ 37%] Building C object bindings/ruby/CMakeFiles/rbwsman.dir//openwsman.o
Linking C shared library _openwsman.so
[ 37%] Built target rbwsman
Scanning dependencies of target ruby_gem
[ 38%] Generating ext
[ 39%] Generating html
Creating rdoc documentation .../bin/sh: ./rdoc2.2: No such file or directory
make[2]: *** [bindings/ruby/html] Error 127
make[1]: *** [bindings/ruby/CMakeFiles/ruby_gem.dir/all] Error 2
make: *** [all] Error 2
As I thought this might be a bug or a mistake in my compiling process, I reported the issue to the developer of openwsman (Thanks Klaus Kämpf) on github and he looked into it and was able to update openwsman to ensure support for Ruby 2.2 which appears to be where the issue was. I included the github issue I posted below, which includes his response. After pulling down the latest code, I was able to successfully compile, make and install openwsman.
https://github.com/Openwsman/openwsman/issues/52
I'm trying to build a project on my new macbook which was previously built normally on linux computers.
at first when i run cmake, i get a the following:
-- The C compiler identification is Clang 5.1.0
-- The CXX compiler identification is Clang 5.1.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
-- 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
-- Performing Test HAVE_CLOCK_GETTIME
-- Performing Test HAVE_CLOCK_GETTIME - Failed
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- graph
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- -> doxygen not found -> api-doc will not be created
-- Configuring done
-- Generating done
-- Build files have been written to: /path/to/folder
and then when i run make, it works till around 30% and then it stop with this error:
/path/to/project/lib/helpers.cpp:555:2: error: use of undeclared identifier 'gettimeofday'
gettimeofday(&tv, NULL);
^
1 error generated.
make[2]: *** [lib/CMakeFiles/genom.dir/helpers.cpp.o] Error 1
make[1]: *** [lib/CMakeFiles/genom.dir/all] Error 2
make: *** [all] Error 2
I looked online, there was some suggestions for changing clock_gettime(CLOCK_REALTIME, &t); to clock_get_time(CLOCK_REALTIME, &t);
but they didnt work.
The error message you provided indicates that gettimeofday wasn't included. What clock_gettime has to do with it is not possible to say from the information you provided.
A quick search about this yields, that gettimeofday should be available (it's part of POSIX).
Do you have #include <sys/time.h>(Apple Docs) or #include <sys/types.h>(SO Answer)?