Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
merging with develop before release
  • Loading branch information
bbercovici committed Sep 24, 2018
2 parents e3b12b6 + 4420a18 commit 97773d9
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 243 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,12 @@
#
################################################################################

cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)

if (${USE_GCC})
include(cmake/FindOmpGcc.cmake)
else()
set(CMAKE_C_COMPILER /usr/bin/gcc CACHE STRING "C Compiler" FORCE)
set(CMAKE_CXX_COMPILER /usr/bin/g++ CACHE STRING "C++ Compiler" FORCE)
endif()

get_filename_component(dirName ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(LIB_NAME "YORPLib" CACHE STRING "Name of library to be created.")


project(${LIB_NAME})

# Specify the version used
Expand All @@ -68,12 +61,12 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
include_directories(include)

# Find OpenMP
# find_package(OpenMP REQUIRED)
find_package(OpenMP)
if(OpenMP_C_FLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
endif()

# Add source files in root directory
add_library(${LIB_NAME}
SHARED
Expand All @@ -86,6 +79,13 @@ add_library(${LIB_NAME}
)


if (UNIX AND APPLE)
target_link_libraries(${LIB_NAME} ${library_dependencies} OpenMP::OpenMP_CXX)
else()
target_link_libraries(${LIB_NAME} ${library_dependencies})
endif()


# If ${BREW} is true, installing from homebrew formula
if(NOT BREW)
install (TARGETS ${LIB_NAME} DESTINATION /usr/local/lib/)
Expand Down
9 changes: 2 additions & 7 deletions Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
#
#
################################################################################
cmake_minimum_required(VERSION 3.0)


# Building procedure
get_filename_component(dirName ${CMAKE_CURRENT_SOURCE_DIR} NAME)
set(EXE_NAME ${dirName} CACHE STRING "Name of executable to be created.")

include(cmake/FindOmpGcc.cmake)

project(${EXE_NAME})

Expand All @@ -56,17 +56,12 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/source/cmake)
add_definitions(-Wall -O2 )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")

# Find OpenMP
find_package(OpenMP REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")

# Find YORPLib
find_package(YORPLib REQUIRED)
include_directories(${YORPLIB_INCLUDE_HEADER})

# Add source files in root directory
add_executable(${EXE_NAME} main.cpp)

target_link_libraries(${EXE_NAME} ${YORPLIB_LIBRARY})

target_link_libraries(${EXE_NAME} ${YORPLIB_LIBRARY})
104 changes: 0 additions & 104 deletions Example/cmake/FindOmpGcc.cmake

This file was deleted.

20 changes: 2 additions & 18 deletions Example/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ int main(int argc, const char * argv[])
// Inputs have two choices, either a file was input on the command line, or there will be prompts on the screen
// to start, just do the file option
// When implment screen option, write the inputs to a file for re-use
string objFileName, opticalFileName, outputFileBaseName, inFileName;
string objFileName, opticalFileName, outputFileBaseName;
string inFileName = "../input_use1.txt";
int numVox, opticalFlag;
double rho, spec;
double lambdaDel;
Expand All @@ -54,23 +55,6 @@ int main(int argc, const char * argv[])
int howManyBounces;
int numrefine;

if (argc == 1) {
// Screen option used if no extra input arguments
cout << "Enter full path to input file:\n";
getline (cin, inFileName);
} else if (argc==2) {
// File option used if 1 extra input argument (the file name)
// make this into a sub-function in the future

// Open the file
inFileName = argv[1];

} else {
// Error!
cerr << "This program takes zero or one inputs only\n";
exit(1);
}

ifstream inFile(inFileName);
string linestr;

Expand Down
1 change: 0 additions & 1 deletion Example/test.cmake

This file was deleted.

104 changes: 0 additions & 104 deletions cmake/FindOmpGcc.cmake

This file was deleted.

0 comments on commit 97773d9

Please sign in to comment.