cmake-Unable to find the requested Boost libraries - visual-studio

I want to use CGAL libraries , I'm using :
CGAL 4.10 ,Microsoft visual studio 2013 , CMake 3.9.3 , boost 1.65, QT creator 4.3.1
while Configuring CGAL using Cmake , it is showing the following errors:
Looking for pthread.h
Looking for pthread.h - not found
Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.9/Modules/FindBoost.cmake:1902 (message):
Unable to find the requested Boost libraries.
Unable to find the Boost header files. Please set BOOST_ROOT to the root
directory containing Boost or BOOST_INCLUDEDIR to the directory containing
Boost's headers.
Call Stack (most recent call first):
cmake/modules/CGAL_SetupBoost.cmake:21 (find_package)
cmake/modules/CGAL_SetupDependencies.cmake:85 (include)
CMakeLists.txt:681 (include)
Boost include: Boost_INCLUDE_DIR-NOTFOUND
Boost libraries:
Boost definitions:
USING BOOST_VERSION = '..'
== Detect external libraries (DONE) ==
== Write compiler_config.h ==
Performing Test CGAL_CFG_DENORMALS_COMPILE_BUG - Success
Performing Test CGAL_CFG_FPU_ROUNDING_MODE_UNWINDING_VC_BUG - Success
Performing Test CGAL_CFG_IEEE_754_BUG - Success
Performing Test CGAL_CFG_ISTREAM_INT_BUG - Success
Performing Test CGAL_CFG_MATCHING_BUG_5 - Success
Performing Test CGAL_CFG_MATCHING_BUG_6 - Failed
Performing Test CGAL_CFG_MATCHING_BUG_7 - Failed
Performing Test CGAL_CFG_MATCHING_BUG_8 - Success
Performing Test CGAL_CFG_NESTED_CLASS_FRIEND_DECLARATION_BUG - Failed
Performing Test CGAL_CFG_NO_LIMITS - Success
Performing Test CGAL_CFG_NO_NEXTAFTER - Failed
Performing Test CGAL_CFG_NO_STL - Success
Performing Test CGAL_CFG_NUMERIC_LIMITS_BUG - Success
Performing Test CGAL_CFG_OUTOFLINE_MEMBER_DEFINITION_BUG - Success
Performing Test CGAL_CFG_TEMPLATE_IN_DEFAULT_PARAMETER_BUG - Success
Performing Test CGAL_CFG_TYPENAME_BEFORE_DEFAULT_ARGUMENT_BUG - Success
Performing Test CGAL_CFG_USING_BASE_MEMBER_BUG_2 - Success
== Write compiler_config.h (DONE) ==
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
Boost_INCLUDE_DIR (ADVANCED)
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL_Core
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL_Core
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL_ImageIO
used as include directory in directory C:/dev/CGAL-4.10/src/CGAL_ImageIO
I added Boost_INCLUDE_DIR,BOOST_ROOT manually to environment vairables
Boost_INCLUDE_DIR=C:\dev\boost_1_65_0;BOOST_ROOT=C:\dev\boost_1_65_0
I tried many versions of boost ,cmake and cgal with visual sutudio 2015 , 2013 and non of the was working
I appreciate any help.thank you

If you are using Cygwin, you can use cmake-gui and use the interface to fill your path, this limits the risk of typos and it is more obvious to find the missing fields.
Another option is to edit hte CMakeCache.txt in your build directory to give the paths, so you don't have to declare the variables as environment variables.

Related

Gtest discover_tests failing in Github Actions: Process terminated due to timeout

I am using google-test(gtest) with CMake and running the unit tests as GitHub ci jobs for Linux and Mac. The Linux jobs pass successfully. However, I am getting an error for the mac runner.
The error is
CMake Error at /usr/local/Cellar/cmake/3.21.1/share/cmake/Modules/GoogleTestAddTests.cmake:77 (message):
Error running test executable.
Path: '/Users/runner/work/splitwebp/build/test/splitwebp_tests'
Result: Process terminated due to timeout
Output:
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.21.1/share/cmake/Modules/GoogleTestAddTests.cmake:173 (gtest_discover_tests_impl)
This is the CMakelists.txt for the tests directory
# CMake config file for unit tests
# Requiring V 3.10 for gtest_discover_tests
cmake_minimum_required(VERSION 3.10)
find_package(OpenCV REQUIRED)
enable_testing()
# finds all .cpp files under this directory (./test) and add them to executable
file(GLOB_RECURSE tests "*.cpp")
file(GLOB_RECURSE source "../src/*.cpp")
add_executable(splitwebp_tests ${tests} ${source})
include_directories("../3rdparty/libwebp/include")
# Link gtest libraries
target_link_libraries(splitwebp_tests ${OpenCV_LIBS})
target_link_libraries(splitwebp_tests webp webpdemux pthread)
target_link_libraries(splitwebp_tests gtest_main)
set(CTEST_OUTPUT_ON_FAILURE 1)
# Find all tests in all .cpp files and convert to CTests
include(GoogleTest)
gtest_discover_tests(splitwebp_tests)
How do I fix the CI pipeline?
The problem is gtest_discover_tests(...) is taking too long and thus getting timed out. The obvious solution is to increase the timeout limit.
The line
gtest_discover_tests(splitwebp_tests)
can be replaced with
gtest_discover_tests(splitwebp_tests PROPERTIES TIMEOUT 600)

Ansys fluent UDF file not being complied

I have tried to build my udf file after adding it. I ran as follows:
tbin\win64/DOF_Sol - Copy.c to libudf\src
udf_names.c and user_nt.udf files in 2ddp_host are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v181\fluent"\fluent18.1.0\src\udf\makefile_nt.udf "libudf\win64\2ddp_host\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2ddp_host")udf_names.c and user_nt.udf files in 2ddp_node are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~1\v181\fluent"\fluent18.1.0\src\udf\makefile_nt.udf "libudf\win64\2ddp_node\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\2ddp_node")
Done.
Later while compling it an error is popig up.
Inc\v181\fluent\ntbin\win64\libudf"...
Error at Node 0: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified.
Error at host: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified.
C:\Program Files\ANSYS Inc\v181\fluent\ntbin\win64\libudf\win64\2ddp_host\libudf.dll
Error at Node 1: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified.
Error at Node 2: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified.
Error at Node 3: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified.
Error at Node 4: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified.
Error at Node 5: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).
The system cannot find the file specified.
C:\Program Files\ANSYS Inc\v181\fluent\ntbin\win64\libudf\win64\2ddp_node\libudf.dll
C:\Program Files\ANSYS Inc\v181\fluent\ntbin\win64\libudf\win64\2ddp_node\libudf.dll
C:\Program Files\ANSYS Inc\v181\fluent\ntbin\win64\libudf\win64\2ddp_node\libudf.dll
C:\Program Files\ANSYS Inc\v181\fluent\ntbin\win64\libudf\win64\2ddp_node\libudf.dll
C:\Program Files\ANSYS Inc\v181\fluent\ntbin\win64\libudf\win64\2ddp_node\libudf.dll
C:\Program Files\ANSYS Inc\v181\fluent\ntbin\win64\libudf\win64\2ddp_node\libudf.dll
MPI Application rank 0 exited before MPI_Finalize() with status 2
The fl process could not be started.
error message
I have been running my fluent from vs prompt itself. I had set all the environment paths requied for the execution. The coding is working absolutly fine.
This is common if you have chosen ansys parallel run.
It should be solved by selecting the serial version at the start of Fluent.
Other way is to have PRF_GRSUMx(variable) constructs in your UDF which take care for global summation.

Failing to build Boost components locally with Bazel build

I am trying to build Boost library locally and want to use it as a local_repository in my own project. I am referring to this (https://github.com/nelhage/rules_boost) for help.
I have a directory tree like this:
boost/ // root of the boost project
|
bazel/
| |
| boost.bzl // contains "boost_library" function from https://github.com/nelhage/rules_boost/blob/master/boost/boost.bzl
| |
| BUILD // empty
boost/ // the original boost headers folder from original boost dist
|
lib/ // the original boost sources folder from original boost dist
|
BUILD
|
WORKSPACE
The BUILD file looks like this one:
https://github.com/nelhage/rules_boost/blob/master/BUILD.boost
with properly loading boost.bzl
The WORKSPACE is just:
workspace( name = "boost" )
The issue:
Now I am trying to build individual components (bazel build //:<component>).
Some of the components (Boost.Container, Boost.Test) are failing to build for a similar reason (not finding header files).
bazel build //:container 1 ↵
INFO: Found 1 target...
ERROR: /home/spyder/codebase/boost/BUILD:103:1: C++ compilation of rule '//:container' failed: Process exited with status 1 [sandboxed].
libs/container/src/global_resource.cpp:12:51: fatal error: boost/container/pmr/memory_resource.hpp: No such file or directory
compilation terminated.
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:container failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 0.519s, Critical Path: 0.18s
bazel build //:test 1 ↵
INFO: Found 1 target...
ERROR: /home/spyder/codebase/boost/BUILD:581:1: C++ compilation of rule '//:test' failed: Process exited with status 1 [sandboxed].
libs/test/src/junit_log_formatter.cpp:11:51: fatal error: boost/test/impl/junit_log_formatter.ipp: No such file or directory
compilation terminated.
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //:test failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.027s, Critical Path: 0.82s
Can anyone guide me on fixing it ?
EDIT:
I also tried to query the expanded cc_library rule by bazel query --output=build //:container and got this
cc_library(
name = "container",
visibility = ["//visibility:public"],
generator_name = "container",
generator_function = "boost_library",
generator_location = "/home/spyder/codebase/boost/BUILD:103",
licenses = ["notice"],
deps = ["//:config", "//:core", "//:intrusive", "//:move"],
defines = [],
includes = ["boost/container/"],
copts = ["-Wno-unused-value"],
srcs = ["//:libs/container/src/alloc_lib.c", "//:libs/container/src/dlmalloc.cpp", "//:libs/container/src/dlmalloc_2_8_6.c", "//:libs/container/src/dlmalloc_ext_2_8_6.c", "//:libs/container/src/global_resource.cpp", "//:libs/container/src/monotonic_buffer_resource.cpp", "//:libs/container/src/pool_resource.cpp", "//:libs/container/src/synchronized_pool_resource.cpp", "//:libs/container/src/unsynchronized_pool_resource.cpp"],
hdrs = [ ....... , "//:boost/container/pmr/map.hpp", "//:boost/container/pmr/memory_resource.hpp", "//:boost/container/pmr/monotonic_buffer_resource.hpp", "//:boost/container/pmr/polymorphic_allocator.hpp", ........ ],
)
Very shockingly, the source file which is complaining (libs/container/src/global_resource.cpp) and the header that it is complaining about (boost/container/pmr/memory_resource.hpp) are both correctly included in the srcs and hdrs list.
I played with your rules a bit and the biggest problem I see is incomplete dependencies. For example I tried :algorithm component, and that needs to depend on :tuple. I guess you just needs to make sure all dependencies are set correctly.
I played more with container, and the problem I encountered was incorrect include dirs. If you run your build with -s flag, bazel will output all the command lines so you can inspect them and check that -isystem flags contain the directory that contains boost/container/... . What can also help you is the bazel flag --sandbox_debug, which will prevent the sandbox directory from being deleted so you can see which files are where and also you can reproduce the compiler invocation without running through bazel.
Last, bazel does not understand .ipp header extension yet (tbh I've never heard of it, but I also know next to nothing about boost). I have a change in flight that will introduce this.

Execution error when out-of stack enviroment, using text-icu on windows

I wrote some code. and fixed some errors with the help of good persons.
Now, this utility(samChecker-exe.exe) works properly in Stack environment.
This utility use text-icu and I coded this utility on windows. Of course, I want to work this utility on other windows OS.
I copied %stackPath%.stack-work\install\~\bin\samCheceker-exe.exe to some other folder, and execution through CMD.
But I got error message that says "libicuuc57.dll dose not exist. so program can't start. please re-install the program."
I copied libicuuc57.dll, and so... as like programming newbies, but failed. "stack install" command was the same result.
(I installed text-icu and installed ICU lib. on windows. The input file encoded in "MS949")
With help of Francesco Ariis from (beginners#haskell.org), I stepped forward.
But still got error message.
C:\Users\shaeg\Documents\Haskell\samChecker3> stack build --ghc-options="-static -optl-static"
Warning: File listed in samChecker3.cabal file does not exist: README.md
samChecker3-0.1.0.0: unregistering (local file changes: app\Main.hs samChecker3.cabal src\Lib.hs test\Spec.hs)
samChecker3-0.1.0.0: configure (lib + exe)
Configuring samChecker3-0.1.0.0...
samChecker3-0.1.0.0: build (lib + exe)
Preprocessing library samChecker3-0.1.0.0...
[1 of 1] Compiling Lib ( src\Lib.hs, .stack-work\dist\ca59d0ab\build\Lib.o )
Preprocessing executable 'samChecker3-exe' for samChecker3-0.1.0.0...
[1 of 1] Compiling Main ( app\Main.hs, .stack-work\dist\ca59d0ab\build\samChecker3-exe\samChecker3-exe-tmp\Main.o )
Linking .stack-work\dist\ca59d0ab\build\samChecker3-exe\samChecker3-exe.exe ...
C:/Users/shaeg/AppData/Local/Programs/stack/x86_64-windows/ghc-8.0.2/mingw/bin/ld.exe: cannot find -licuuc
C:/Users/shaeg/AppData/Local/Programs/stack/x86_64-windows/ghc-8.0.2/mingw/bin/ld.exe: cannot find -licuin
C:/Users/shaeg/AppData/Local/Programs/stack/x86_64-windows/ghc-8.0.2/mingw/bin/ld.exe: cannot find -licudt
collect2.exe: error: ld returned 1 exit status
`gcc.exe' failed in phase `Linker'. (Exit code: 1)
Warning: File listed in samChecker3.cabal file does not exist: README.md
-- While building package samChecker3-0.1.0.0 using:
C:\sr\setup-exe-cache\x86_64-windows\Cabal-simple_Z6RU0evB_1.24.2.0_ghc-8.0.2.exe --builddir=.stack-work\dist\ca59d0ab build lib:samChecker3 exe:samChecker3-exe --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
[stack path] results
extra-include-dirs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include
extra-library-dirs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
According to first error message(libicuuc57.dll dose not exist. so program can't start. please re-install the program.), I find the path for libicuuc57.dll, and re-set the extra-library-dirs.
C:\Users\shaeg\Documents\Haskell\samChecker3>stack build --extra-lib-dirs=C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin --ghc-options="-static -optl-static"
But got the same result.
libicuuc75.dll, libicuin57.dll etc files is located in C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin
Someones says, this is Linker Acting.
How can I fix this error?
Thank you so much.
Sincerely, S. Chang.
Here is my stack path.
C:\Users\shaeg\Documents\Haskell\samChecker3>stack path
stack-root: C:\sr
project-root: C:\Users\shaeg\Documents\Haskell\samChecker3
config-location: C:\Users\shaeg\Documents\Haskell\samChecker3\stack.yaml
bin-path: .;C:\sr\snapshots\7dd4ddea\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\usr\bin;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\usr\local\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\IntelSGXPSW\bin\x64\Release\;C:\Program Files\Intel\IntelSGXPSW\bin\win32\Release\;c:\Program Files\Intel\WiFi\bin\;c:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Hewlett-Packard\SimplePass\;C:\Users\shaeg\AppData\Roaming\local\bin;C:\Users\shaeg\AppData\Local\Microsoft\WindowsApps
programs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows
compiler-exe: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin\ghc.EXE
compiler-bin: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\bin
local-bin: C:\Users\shaeg\AppData\Roaming\local\bin
extra-include-dirs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\include
extra-library-dirs: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\msys2-20150512\mingw64\lib
snapshot-pkg-db: C:\sr\snapshots\7dd4ddea\pkgdb
local-pkg-db: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14\pkgdb
global-pkg-db: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\lib\package.conf.d
ghc-package-path: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14\pkgdb;C:\sr\snapshots\7dd4ddea\pkgdb;C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\lib\package.conf.d
snapshot-install-root: C:\sr\snapshots\7dd4ddea
local-install-root: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14
snapshot-doc-root: C:\sr\snapshots\7dd4ddea\doc
local-doc-root: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14\doc
dist-dir: .stack-work\dist\ca59d0ab
local-hpc-root: C:\Users\shaeg\Documents\Haskell\samChecker3\.stack-work\install\02136e14\hpc
local-bin-path: C:\Users\shaeg\AppData\Roaming\local\bin
ghc-paths: C:\Users\shaeg\AppData\Local\Programs\stack\x86_64-windows
I was able to test it recently, and share my solution.
First of all, I assume environment of latest msys2 which is installed mingw64/mingw-w64-x86_64-icu 57.1-2 package.
Dynamic linking
Executable which dynamically linked has dependencies to libgcc_s_seh-1.dll libicudt57.dll libicuin57.dll libicuuc57.dll libstdc++-6.dll libwinpthread-1.dll under stack's msys2 mingw64/bin path. If you have already built dynamic linked executable, copying all of them to same directory will solve the problem.
Dependency walker in my comment can help to reveal all of these dependencies.
Static linking
Currently text-icu package doesn't seem to support static linking. So we should modify it ourselves. If you don't know how to make it into local package, note the third option of this.
Modify text-icu-0.7.0.1's .cabal file extra-libraries section to the following.
extra-libraries: sicuin sicuuc sicudt
-- if os(mingw32)
-- extra-libraries: icuin icudt
-- else
-- extra-libraries: icui18n icudata
Append -pgmlC:\Users\[USERNAME]\AppData\Local\Programs\stack\x86_64-windows\ghc-8.0.2\mingw\bin\g++.exe to your executable's ghc-options cabal entry. This is required to link to ICU's C++ symbols.
Then just do stack build.

OpenCV and VisualStudio 2010 dll problems

Hi everyone I would like to try the openCV library but I have some problems setting up the environment.
From the property Manager I created a new sheet and set:
VC++ Directories :
- Include Directories: $(OPENCV_DIR)\build\x86\vc10\bin and $(OPENCV2_DIR)\build\include
- Library Directories: $(OPENCV2_DIR)\build\x86\vc10\lib;
C/C++ :
- Additional Includes Directories: $(OPENCV2_DIR)\include;
Linker:
opencv_calib3d244d.lib opencv_contrib244d.lib opencv_core244d.lib
opencv_features2d244d.lib opencv_flann244d.lib opencv_gpu244d.lib
opencv_haartraining_engined.lib opencv_highgui244d.lib
opencv_imgproc244d.lib opencv_legacy244d.lib opencv_ml244d.lib
opencv_nonfree244d.lib opencv_objdetect244d.lib opencv_photo244d.lib
opencv_stitching244d.lib opencv_ts244d.lib opencv_video244d.lib
opencv_videostab244d.lib
-Additional Library Directories: $(OPENCV2_DIR)\libs
I can compile but i can't execute the program because I get an error opencv_core242.dll is missing.
Where's my error? Thanks
"I get an error opencv_core242.dll is missing"
if you linked against the libs in opencv\build\x86\vc10\lib (your compiler/linker settings look ok),
you'll have to append
opencv\build\x86\vc10\bin
to your PATH environment variable, so your exe can find the dlls at runtime.

Resources