Skip to content

Commit

Permalink
Proposed fix for Mojave build errors related to location of cstring h…
Browse files Browse the repository at this point in the history
…eaders
  • Loading branch information
maxieds committed Feb 24, 2021
1 parent 9ac4197 commit d3718be
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 14 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,18 +122,17 @@ else()
set(RHEL_LINKER_APPENDS "")
endif()
if(APPLE)
#"${CMAKE_CXX_FLAGS} -Wall -std=c++14 -stdlib=libc++ -fPIC -fopenmp -g -O2 -fno-lto
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -Wall -mlinker-version=450 -std=c++14 -fPIC -fopenmp -g -O2 -fno-lto \
"${CMAKE_CXX_FLAGS} -Wall -mlinker-version=450 -isystem /usr/local/opt/llvm/include \
-std=c++14 -fPIC -fopenmp -g -O2 -fno-lto \
-I/usr/local/include -I/usr/local/opt/llvm/include -Igtfold-mfe/include/ \
-DGTFOLD_PACKAGE_VERSION=\"${GTFOLD_PACKAGE_VERSION}\"" #${PC_GMP_INCLUDE_DIRS} ${PC_GMPXX_INCLUDE_DIRS}
)
# NOTE: Providing the explicit LLVM linker path seems to fix the problems on Mojave.
set(CMAKE_EXE_LINKER_FLAGS
"${CMAKE_CXX_FLAGS} ${CMAKE_EXE_LINKER_FLAGS} \
-mlinker-version=450 -L/usr/local/lib -lm -lpthread \
-L/usr/local/opt/llvm/lib \
${PC_GMP_LIBRARIES} ${PC_GMPXX_LIBRARIES}"
-L/usr/local/opt/llvm/lib ${PC_GMP_LIBRARIES} ${PC_GMPXX_LIBRARIES}"
)
elseif(UNIX AND NOT APPLE) # Primary target: Linux (typically RHEL)
set(CMAKE_CXX_FLAGS
Expand Down
5 changes: 3 additions & 2 deletions gtfold-mfe/include/partition-func-d2.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <string.h>
#include <cstring>
#include <math.h>

//#include "MyDouble.cc"
Expand Down Expand Up @@ -106,7 +107,7 @@ class PartitionFunctionD2{
#include "algorithms-partition.h"
#include "global.h"
#include "utils.h"
#include<omp.h>
#include <omp.h>
#include <assert.h>
#define MEMORY_OPTIMIZATION_ENABLED false
#define PAIRABLE_POINTS_GATHER_OPTIMIZATION_DISABLED true
Expand Down
3 changes: 2 additions & 1 deletion gtfold-mfe/include/stochastic-sampling-d2.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ class StochasticTracebackD2{
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <string.h>
#include <cstring>
#include <stack>
#include <map>
#include<sstream>
Expand Down
3 changes: 2 additions & 1 deletion gtfold-mfe/src/binexe-utils/calc_pnum.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <string.h>
#include <cstring>
#include <stack>
#include <map>
#include<sstream>
Expand Down
3 changes: 2 additions & 1 deletion gtfold-mfe/src/binexe-utils/limitCDboltzmanntest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#include<sstream>
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
//#include<string.h>
#include <cstring>
#include <stack>
using namespace std;

Expand Down
3 changes: 2 additions & 1 deletion gtfold-mfe/src/binexe-utils/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <string.h>
#include <cstring>

#include "main.h"
#include "mfe_main.h"
Expand Down
3 changes: 2 additions & 1 deletion gtfold-mfe/src/constraints.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <stdlib.h>
#include <string.h>
//#include <string.h>
#include <cstring>
#include <stdio.h>
#include <iostream>
#include <fstream>
Expand Down
3 changes: 2 additions & 1 deletion gtfold-mfe/src/mfe_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <string.h>
#include <cstring>
#include <cassert>

#include "main.h"
Expand Down
3 changes: 2 additions & 1 deletion gtfold-mfe/src/shapereader.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include<iostream>
#include<fstream>
#include<string.h>
//#include<string.h>
#include <cstring>
#include<stdio.h>
#include <stdlib.h>
#include <math.h>
Expand Down
3 changes: 2 additions & 1 deletion gtfold-mfe/src/stochastic-sampling.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
//#include <string.h>
#include <cstring>
#include <stack>
#include <map>
#include<sstream>
Expand Down

0 comments on commit d3718be

Please sign in to comment.