sararselitsky / FastPG

Fast phenograph, CyTOF
Other
25 stars 6 forks source link

Installation #12

Closed Stein-ErikG closed 3 years ago

Stein-ErikG commented 3 years ago

Hi,

Ive spent a lot of time trying to install FastPG with no success :/ Ive installed brew, clang, macports, XML and a bunch of other dependencies in R. Im still stuck with the following error message (the interesting part of it at least – i think):

In file included from buildNextPhase.cpp:42: ./defs.h:52:10: fatal error: 'omp.h' file not found

include

     ^~~~~~~

1 error generated. make: *** [buildNextPhase.o] Error 1 ERROR: compilation failed for package ‘FastPG’

Could you please help me? What am i missing? (im on a mac)

sararselitsky commented 3 years ago

We had an update fairly recently. When did you install FastPG?

This looks like a C++ error. Mahantesh, have you seen this error before?

On Wed, Aug 18, 2021 at 3:57 AM Stein-ErikG @.***> wrote:

Hi,

Ive spent a lot of time trying to install FastPG with no success :/ Ive installed brew, clang, macports, XML and a bunch of other dependencies in R. Im still stuck with the following error message (the interesting part of it at least – i think):

In file included from buildNextPhase.cpp:42: ./defs.h:52:10: fatal error: 'omp.h' file not found

include

^~~ 1 error generated. make: *** [buildNextPhase.o] Error 1 ERROR: compilation failed for package ‘FastPG’

Could you please help me? What am i missing?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/sararselitsky/FastPG/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQD6T4HETUAYTP2FCDI4VTT5NRWFANCNFSM5CLO3FNQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

Stein-ErikG commented 3 years ago

Ive been trying this week.

sararselitsky commented 3 years ago

It is a rather common error to get omp working. This seems like a good resource: https://stackoverflow.com/questions/25990296/how-to-include-omp-h-in-os-x

Briefly, action one would be to install omp: “brew install libomp” --- if this does not work, next step will be to install gcc: “brew install gcc” and use gcc to compile.

Regards, Mahantesh (he/him)

From: Sara Selitsky @.> Date: Wednesday, August 18, 2021 at 4:48 AM To: sararselitsky/FastPG @.>, "Jefferys, Stuart R" @.>, "Halappanavar, Mahantesh M" @.> Subject: Re: [sararselitsky/FastPG] Installation (#12)

Check twice before you click! This email originated from outside PNNL.

We had an update fairly recently. When did you install FastPG?

This looks like a C++ error. Mahantesh, have you seen this error before?

On Wed, Aug 18, 2021 at 3:57 AM Stein-ErikG @.**@.>> wrote:

Hi,

Ive spent a lot of time trying to install FastPG with no success :/ Ive installed brew, clang, macports, XML and a bunch of other dependencies in R. Im still stuck with the following error message (the interesting part of it at least – i think):

In file included from buildNextPhase.cpp:42: ./defs.h:52:10: fatal error: 'omp.h' file not found

include

^~~ 1 error generated. make: *** [buildNextPhase.o] Error 1 ERROR: compilation failed for package ‘FastPG’

Could you please help me? What am i missing?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fsararselitsky%2FFastPG%2Fissues%2F12&data=04%7C01%7CMahantesh.Halappanavar%40pnnl.gov%7Cb007a06930a54b66b33708d9623e1c85%7Cd6faa5f90ae240338c0130048a38deeb%7C0%7C0%7C637648841176416313%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=rMb2tsGWZl06RhDECEJwB7oYuFKKde6cFz9cMLAdJI8%3D&reserved=0, or unsubscribehttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACQD6T4HETUAYTP2FCDI4VTT5NRWFANCNFSM5CLO3FNQ&data=04%7C01%7CMahantesh.Halappanavar%40pnnl.gov%7Cb007a06930a54b66b33708d9623e1c85%7Cd6faa5f90ae240338c0130048a38deeb%7C0%7C0%7C637648841176426267%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ZsXnRwhEcOnixoR0n6J9YNV8x1seXzYhqhG9GWElfgE%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7CMahantesh.Halappanavar%40pnnl.gov%7Cb007a06930a54b66b33708d9623e1c85%7Cd6faa5f90ae240338c0130048a38deeb%7C0%7C0%7C637648841176426267%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=0GMeTDAOeGwyqd%2BV87CzRFtHfSPDDaA%2FbH0pUiWPxhA%3D&reserved=0 or Androidhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26utm_campaign%3Dnotification-email&data=04%7C01%7CMahantesh.Halappanavar%40pnnl.gov%7Cb007a06930a54b66b33708d9623e1c85%7Cd6faa5f90ae240338c0130048a38deeb%7C0%7C0%7C637648841176426267%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xQ1N3nBwhiK4OQw4UVBKEizh6w36nDgwovfCzRs0u8k%3D&reserved=0.

Stein-ErikG commented 3 years ago

Hi,

Thank you for the quick reply! “brew install libomp” fixed the omp issue. When trying to install FastPG im now getting the following error just before finishing the installation:


** testing if installed package can be loaded from temporary location Error: package or namespace load failed for ‘FastPG’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-FastPG/00new/FastPG/libs/FastPG.so': dlopen(/Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-FastPG/00new/FastPG/libs/FastPG.so, 6): Symbol not found: _omp_destroy_lock Referenced from: /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-FastPG/00new/FastPG/libs/FastPG.so Expected in: flat namespace in /Library/Frameworks/R.framework/Versions/4.1/Resources/library/00LOCK-FastPG/00new/FastPG/libs/FastPG.so Error: loading failed Execution halted

Im not able to install gcc (“brew install gcc”) because of some premission issue. But im not sure this is the issue preventing me from getting the package installed. seems to be a path to library error?

Stein-ErikG commented 3 years ago

Update: Now both gcc and g++ seems to work and are symlinked:

adgkmv020f8j8:ENESTN007 mmasg$ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.0 (clang-1100.0.33.8) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin adgkmv020f8j8:ENESTN007 mmasg$ g++ --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1 Apple clang version 11.0.0 (clang-1100.0.33.8) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin adgkmv020f8j8:ENESTN007 mmasg$

But still the same error (Error: package or namespace load failed for ‘FastPG’ in dyn.load(file, DLLpath = DLLpath, ...):) when i try to install...

jefferys commented 3 years ago

Were there any messages earlier? This indicates the build of FastPG did not complete, but no error stopped it from continuing and trying to install. Also, my version of Clang is 12, not 11. What version of Apple are you on, and have you updated/installed Xcode or the apple command line tools recently?

Stein-ErikG commented 3 years ago

1) im on macOS Catalina v 10.15.7.

2) Yes, while trying to get this installed i tried to update xcode (now 11.1 to 11.7). did the enitre installation (and agree to the terms and conditions). I then installed the gcc and g++ through Brew again. no help.

3) I re-installed clang today (sudo port install clang-12 ), but i still only have 11:

adgkmv020f8j8:ENESTN007 mmasg$ clang --version Apple clang version 11.0.0 (clang-1100.0.33.8) Target: x86_64-apple-darwin19.6.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

4) There are a bunch of warnings while it is working. Ill paste a few here, the all look very similar.

clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppParallel/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -I/usr/local/include -fPIC -Wall -g -O2 -c utilityDataStructures.cpp -o utilityDataStructures.o clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppParallel/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -I/usr/local/include -fPIC -Wall -g -O2 -c utilityFunctions.cpp -o utilityFunctions.o utilityFunctions.cpp:61:10: warning: unused variable 'block' [-Wunused-variable] long block = size / nT; ^ utilityFunctions.cpp:66:12: warning: unused variable 'start' [-Wunused-variable] double start = omp_get_wtime(); ^ utilityFunctions.cpp:105:12: warning: unused variable 'time1' [-Wunused-variable] double time1 = omp_get_wtime(); ^ utilityFunctions.cpp:126:12: warning: unused variable 'time2' [-Wunused-variable] double time2 = omp_get_wtime(); ^ utilityFunctions.cpp:320:30: warning: unused variable 'totalTime' [-Wunused-variable] double time1=0, time2=0, totalTime=0; ^ utilityFunctions.cpp:320:21: warning: unused variable 'time2' [-Wunused-variable] double time1=0, time2=0, totalTime=0; ^ utilityFunctions.cpp:320:12: warning: unused variable 'time1' [-Wunused-variable] double time1=0, time2=0, totalTime=0; ^ utilityFunctions.cpp:436:26: warning: unused variable 'newId' [-Wunused-variable] long newId = NGE; ^ utilityFunctions.cpp:568:55: warning: format specifies type 'int' but the argument has type 'long' [-Wformat] printf("Number of unique communities in C= %d\n", nC); ~~ ^~ %ld 9 warnings generated. clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppParallel/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -I/usr/local/include -fPIC -Wall -g -O2 -c utilitySparsificationFunctions.cpp -o utilitySparsificationFunctions.o utilitySparsificationFunctions.cpp:129:21: warning: unused variable 'time2' [-Wunused-variable] double time1=0, time2=0; ^ utilitySparsificationFunctions.cpp:137:13: warning: unused variable 'simWeights' [-Wunused-variable] double simWeights = (double) malloc (2NEdgesizeof(double)); assert(simWeights != 0); ^ 2 warnings generated. clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppParallel/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -I/usr/local/include -fPIC -Wall -g -O2 -c vBase.cpp -o vBase.o In file included from vBase.cpp:1: ./coloringUtils.h:66:1: warning: '/*' within block comment [-Wcomment] /*** Coloring Functions ** ^ ./coloringUtils.h:68:1: warning: '/' within block comment [-Wcomment] / Basic coloring (unbalanced) in initialColoring.cpp ^ ./coloringUtils.h:70:1: warning: '/' within block comment [-Wcomment] / Basic coloiring (ab-inital) in initialColoringLU.cpp ^ ./coloringUtils.h:73:1: warning: '/' within block comment [-Wcomment] / Vertex base redistribution in vBase.cpp ^ ./coloringUtils.h:82:1: warning: '/' within block comment [-Wcomment] / Color base redistribution in cBase.cpp ^ vBase.cpp:108:8: warning: unused variable 'permissable' [-Wunused-variable] int permissable = 0; ^ vBase.cpp:17:9: warning: unused variable 'verInd' [-Wunused-variable] edge *verInd = G->edgeList; //Vertex Index: destination id of an edge (src -> dest) ^ vBase.cpp:168:1: warning: control may reach end of non-void function [-Wreturn-type] } ^ 8 warnings generated. clang++ -mmacosx-version-min=10.13 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/RcppParallel/include' -I'/Library/Frameworks/R.framework/Versions/4.1/Resources/library/BH/include' -I/usr/local/include -fPIC -Wall -g -O2 -c vertexFollowing.cpp -o vertexFollowing.o vertexFollowing.cpp:106:11: warning: unused variable 'NE_in' [-Wunused-variable] long NE_in = Gin->numEdges; ^ vertexFollowing.cpp:103:10: warning: unused variable 'total' [-Wunused-variable] double total = 0, totItr = 0;
^ vertexFollowing.cpp:103:21: warning: unused variable 'totItr' [-Wunused-variable] double total = 0, totItr = 0;
^ 3 warnings generated. clang++ -mmacosx-version-min=10.13 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o FastPG.so RcppExports.o RngStream.o buildNextPhase.o coloringDistanceOne.o coloringMultiHashMaxMin.o coloringUtils.o dedup_links.o equitableColoringDistanceOne.o fullSyncUtility.o init.o parallelDirectedLouvainMethod.o parallelLouvainMethod.o parallelLouvainMethodApprox-2.o parallelLouvainMethodApprox.o parallelLouvainMethodEarlyTerminate.o parallelLouvainMethodFastTrackResistance.o parallelLouvainMethodFullSync.o parallelLouvainMethodFullSyncEarly.o parallelLouvainMethodInitialized.o parallelLouvainMethodNoMap.o parallelLouvainMethodNoMapFastTrackResistance.o parallelLouvainMethodScale.o parallelLouvainMethodScaleFastTrackResistance.o parallelLouvainWithColoring.o parallelLouvainWithColoringNoMap.o parallel_jc2.o parallel_louvain.o reverseCuthillMcKee.o runDirectedMultiPhaseBasic.o runMultiPhaseBasic.o runMultiPhaseBasicApprox.o runMultiPhaseBasicFastTrackResistance.o runMultiPhaseColoring.o runMultiPhaseSyncType.o utilityClusterComparisonMetrics.o utilityClusteringFunctions.o utilityDataStructures.o utilityFunctions.o utilitySparsificationFunctions.o vBase.o vertexFollowing.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation

Stein-ErikG commented 3 years ago

My makevars.bck looks like this:

Fill with appropriate flag statements

cat <<- EOF > ~/.R/Makevars

clang: start

CFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

clang: end

CPPFLAGS = -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/usr/local/include

EOF

seems okey to you?

jefferys commented 3 years ago

When you try to install FastPG, does it immediately start installing the FastPG package, or try to install some dependencies as well? Since you have already attempted install once, if it is trying to install a dependency, then that is failing first and by default FastPG won't be installed. From the warnings you posted, it looks like RcppParallel is being installed, which shouldn't happen again, although it might after having installed new compiler and os libraries. Try installing FastPG again and see what the list of dependencies it is trying to install is. That will be one of the first things it tells you. If it installs dependencies, check the message at the end of the dependency to see if it says why it failed.

Otherwise, the messages just before the failure you listed previously are likely most informative, e.g. those before "testing if installed package can be loaded from temporary location ... Error: package or namespace load failed for ‘FastPG’ in dyn.load(file, DLLpath = DLLpath, ...):"

Stein-ErikG commented 3 years ago

Hi,

Finally got it to work, thanks for the help! Bur what exactly made the difference now i dont know. I followed this page (https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/#google_vignette) and (re-)installed gfortran. I read in the comment section below that i should create a new makevars file by pasted the following into terminal):

Fill with appropriate flag statements

sudo cat <<- EOF > ~/.R/Makevars

clang: start

CFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk CPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

clang: end

EOF

The result was that the omp issue returned. I tried to re-install gcc and libomp, but that did not help. I noticed that two lines i had before were missing from the new makevars file. I added those (below), and then the installation worked!

CPPFLAGS += -I/usr/local/opt/libomp/include -Xclang -fopenmp LDFLAGS += -L/usr/local/opt/libomp/lib -lomp

I hope that this might help anyone else as well:)