Skip to content

Commit

Permalink
Add threads for GTest (Unix)
Browse files Browse the repository at this point in the history
  • Loading branch information
salvacarrion committed Sep 21, 2020
1 parent 860154e commit c01ee5d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/markdown/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ https://cmake.org/cmake/help/latest/manual/cmake-env-variables.7.html
Short tutorial: (Series: 1,2,3)
https://medium.com/heuristics/c-application-development-part-1-project-structure-454b00f9eddc
Shared libraries/rpaths/...
https://www.cprogramming.com/tutorial/shared-libraries-linux-gcc.html
```

## Requirements
Expand Down
13 changes: 13 additions & 0 deletions scripts/compile_dummy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Set working path
WORKPATH=/home/salvacarrion/Downloads/eddl_compiled/cpu_x86_64_shared__proto_openmp

# Compiling (include headers: eigen3/Eigen/ and eddl/)
g++ -c -Wall -Werror main.cpp -o main.o \
-I$WORKPATH/include \
-I$WORKPATH/include/eigen3 \

# Linking
g++ main.o -o main \
-L$WORKPATH/lib \
-Wl,-rpath=$WORKPATH/lib \
-leddl
3 changes: 2 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ if(MSVC)
optimized ${GTEST_BOTH_LIBRARIES}
debug ${GTEST_BOTH_LIBRARIES_D})
else()
target_link_libraries(unit_tests PUBLIC eddl ${GTEST_BOTH_LIBRARIES})
find_package(Threads)
target_link_libraries(unit_tests PUBLIC eddl ${GTEST_BOTH_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
endif()


Expand Down

0 comments on commit c01ee5d

Please sign in to comment.