Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with Install (Mac Mojave 10.14.6) #26

Open
klhilde opened this issue Nov 14, 2019 · 12 comments
Open

Problems with Install (Mac Mojave 10.14.6) #26

klhilde opened this issue Nov 14, 2019 · 12 comments

Comments

@klhilde
Copy link

klhilde commented Nov 14, 2019

Hello @tractatus,
I am installing whole brain on Mac Mojave 10.14.6 with the following versions of each component:

Xcode 11.2.1
Xquartz 2.7.11
fftw 3.3.8_1
OpenCV 4.1.2

Everything went as instructed until the final step of the installation (if (!require(devtools)) {
install.packages("devtools")
}
devtools::install_github("tractatus/wholebrain", args='--no-multiarch')

after which I receive the following error:
Error: package or namespace load failed for ‘wholebrain’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-wholebrain/00new/wholebrain/libs/wholebrain.so':
dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-wholebrain/00new/wholebrain/libs/wholebrain.so, 6): Symbol not found: __ZN2cv19getRotationMatrix2DENS_6Point_IfEEdd
Referenced from: /Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-wholebrain/00new/wholebrain/libs/wholebrain.so
Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-wholebrain/00new/wholebrain/libs/wholebrain.so
Error: loading failed
Execution halted
ERROR: loading failed

  • removing ‘/Library/Frameworks/R.framework/Versions/3.6/Resources/library/wholebrain’
    Error: Failed to install 'wholebrain' from GitHub:
    (converted from warning) installation of package ‘/var/folders/hb/njx9dl2951s03hfxcr_r_xtr0000gn/T//RtmpKkeYLV/file45924ec64f8b/wholebrain_0.1.1.tar.gz’ had non-zero exit status

Any advice would be greatly appreciated. Thank you!

@crazyhottommy
Copy link

I had the same error..

@tractatus
Copy link
Owner

@klhilde @crazyhottommy
The error:

dlopen(/Library/Frameworks/R.framework/Versions/3.6/Resources/library/00LOCK-wholebrain/00new/wholebrain/libs/wholebrain.so, 6): Symbol not found: __ZN2cv19getRotationMatrix2DENS_6Point_IfEEdd

Indicates that parts of opencv could not be linked. You dont need to compile opencv on your own rather ROpenCVLite should take care of this for you.

I would from R verify that you have it installed:

ROpenCVLite::opencvVersion()

If not:

ROpenCVLite::installOpenCV()

@tractatus
Copy link
Owner

If you have multiple different versions of opencv that it migt try to link to at the same time I would advice to let it link to ROpenCVLite and probably remove version linked through brew.

brew uninstall opencv

restart computer.

@crazyhottommy
Copy link

thanks! I had this step passed. only the last step when installing the R package gives me

Error: package or namespace load failed for ‘wholebrain’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain/libs/wholebrain.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain/libs/wholebrain.so, 6): Symbol not found: __ZN2cv19getRotationMatrix2DENS_6Point_IfEEdd
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain/libs/wholebrain.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain/libs/wholebrain.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain’
Error in i.p(...) : 
  (converted from warning) installation of package ‘/var/folders/j6/snrl5bb526b5v3xv6g1dpkyw0000gp/T//Rtmplf7Nh6/file76be1659064b/wholebrain_0.1.1.tar.gz’ had non-zero exit status

@tractatus
Copy link
Owner

@crazyhottommy dont think the step passed. The error is still:

Symbol not found: __ZN2cv19getRotationMatrix2DENS_6Point_IfEEdd

which should be linked through opencv.

@crazyhottommy
Copy link

okay thanks for replying. I will look into it..

@tractatus
Copy link
Owner

if it helps the getRotationMatrix2D is in the imgproc module of opencv:

https://docs.opencv.org/master/da/d54/group__imgproc__transform.html#gafbbc470ce83812914a70abfb604f4326

So from R you should be able to run the following command:

> ROpenCVLite::opencvConfig()
-L/Library/Frameworks/R.framework/Versions/3.4/Resources/library/ROpenCVLite/opencv/lib -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_gapi -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_video -lopencv_videoio

As you see I here find -lopencv_imgproc which is linking to libopencv_imgproc.4.0.1.dylib

@crazyhottommy
Copy link

> ROpenCVLite::opencvConfig()
-L/Library/Frameworks/R.framework/Versions/3.5/Resources/library/opencv/lib -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_gapi -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_video -lopencv_videoio

then I reinstalled

Error: package or namespace load failed for ‘wholebrain’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain/libs/wholebrain.so':
  dlopen(/Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain/libs/wholebrain.so, 6): Symbol not found: __ZN2cv19getRotationMatrix2DENS_6Point_IfEEdd
  Referenced from: /Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain/libs/wholebrain.so
  Expected in: flat namespace
 in /Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain/libs/wholebrain.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/3.5/Resources/library/wholebrain’

@tractatus
Copy link
Owner

tractatus commented Dec 20, 2019

@crazyhottommy let me double check with what they have changed in recent opencv version because it looks like the file has gone through some serious iterations with switching of data types with Matx23d instead of Mat.

On your end if you check that you dont have multiple conflicting opencv versions in path.

Here are some info on how to check what ROpenCVLite should link against:

> ROpenCVLite::opencvConfig("libs")
-L/Library/Frameworks/R.framework/Versions/3.4/Resources/library/ROpenCVLite/opencv/lib -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_gapi -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_video -lopencv_videoio
> ROpenCVLite::opencvConfig("cflags")
-I/Library/Frameworks/R.framework/Versions/3.4/Resources/library/ROpenCVLite/opencv/include/opencv4 -I/Library/Frameworks/R.framework/Versions/3.4/Resources/library/ROpenCVLite/opencv/include
> ROpenCVLite::opencvVersion()
[1] "Version 4.0.1"

Sorry for any issues your facing currently.

@crazyhottommy
Copy link

thanks! No need to sorry for this. installing is hard for software is a known problem everywhere :)

> ROpenCVLite::opencvConfig("libs")
-L/Library/Frameworks/R.framework/Versions/3.5/Resources/library/opencv/lib -lopencv_calib3d -lopencv_core -lopencv_dnn -lopencv_features2d -lopencv_flann -lopencv_gapi -lopencv_highgui -lopencv_imgcodecs -lopencv_imgproc -lopencv_ml -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_video -lopencv_videoio
> ROpenCVLite::opencvVersion()
[1] "Version 4.1.0"

Trying to dockerize wholebrain and I will update here. Thanks for making this package!

@tractatus
Copy link
Owner

@crazyhottommy Hi I just checked on a completely clean macOS Mojave where I installed via ROpenCVLite which compiled OpenCV 4.1.2. No issues.

One thing that could be going on is multiple versions of opencv getting linked on your system.
But for that probably need to have a quick chat. @crazyhottommy Let me know if you want to Skype or anything to resolve this. You can reach me on my email furth at cshl.edu

@crazyhottommy
Copy link

many thanks! I managed to dockerize it with the help of my colleague. https://github.com/crazyhottommy/wholebrain_docker Thanks for making this package, I will ask other questions when I am using it :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants