Created attachment 183916 [details] shar https://www.rstudio.org Builds in poudriere. Caveat: Java still leaves ~/.java despite ANT_OPTS="-Duser.home=${WRKDIR}". post-build and post-stage delete them.
Created attachment 183917 [details] shar Fixed ~/.java
Created attachment 183969 [details] shar archive
Building your shar archive from 2017-07-01, I get the following error on 12.0-CURRENT amd64: /usr/bin/ld: cannot find -lRblas My math/R was built with option ATLAS enabled instead of option RBLAS. Are there any plans for other BLAS options than the R-bundeld implementaion?
I believe this is the upstream problem: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=220295 libR.pc doesn't contain all libraries that are required to link RStudio. For this reason, files/patch-src_cpp_session_CMakeLists.txt has -lRblas encoded. I suppose RStudio port could go an extra mile and detect what BLAS implementation is linked to libR.so, but the proper way is to do this upstream.
(In reply to Yuri Victorovich from comment #4) Thanks for the fast reply and the clarification. As far as I understand, there is almost no chance to get an upstream solution from the R community in the near future. So, I would vote for a port based solution.
Then the best way is math/R -based solution. They should encode the BLAS library. I will try to create a patch for this.
Patch in bug#220418 should fix the problem with library selection. But bug#220417 also needs to be fixed for RStudio to be able to work.
Created attachment 184002 [details] shar
In order to use any BLAS library choice in R: * Patch from bug#220418 needs to be committed * All BLAS libraries should be switched to fortran:flang
Created attachment 184063 [details] shar RStudio only builds on amd64 and only when FLANG=yes in R, which isn't made a default in R yet because flang is still amd64-only. BROKEN statement explains this. But devel/rstudio works fine, and is useful, and it can be easily manually built by interested users. IMO, it can be committed in the current form with the BROKEN statement. The expectation is that flang will support i386 soon.
Mk/Uses/execinfo.mk has been removed (https://reviews.freebsd.org/D11488). I believe USES=execinfo can simply be removed from the Makefile. The distfiles for the version in the attached patch are no longer fetchable. Changing to PORTVERSION=1.1.383 and updating the distfile resulted in some build errors. http://pkg.awarnach.mathstat.dal.ca/data/11amd64-default/2017-10-27_10h32m55s/logs/errors/rstudio-1.1.383.log
(In reply to Joseph Mingrone from comment #11) Ok, thanks, I will update it.
Created attachment 187532 [details] shar * Updated to the latest version, both RStudio and dependencies * Removed redundant USES * Clarified "ONLY_xxx" message * Tested with few examples - it works fine. I think RStudio is good to be committed (portlint produces a bogus warning, I will create a separate bug report for this.)
Building with poudriere in an 11 jail still fails with the latest patch. http://pkg.awarnach.mathstat.dal.ca/data/11amd64-default/2017-10-27_22h00m17s/logs/errors/rstudio-1.1.383.log
(In reply to Joseph Mingrone from comment #14) The core error seems to be ENFILE (Too many open files in system): > [java] Caused by: java.nio.file.FileSystemException: /tmp/imageio19870471739360284.tmp: Too many open files You need to increase kern.maxfiles in /boot/loader.conf I have kern.maxfiles="25000", and it passes for me in 11.0-RELEASE-p7.
It fails with gfortran because the Makefile is missing USES=fortran. Any port that depends on a port with USES=fortran also needs USES=fortran. Even if it doesn't contain Fortran code it still needs the *FLAGS.
(In reply to Tijl Coosemans from comment #16) Do you have the error message when it fails with gfortran, because I don't get this failure?
Yuri, I believe Tijl (Tijl, please correct me if I am wrong) is responding to your statement, "RStudio only builds on amd64 and only when FLANG=yes in R".
(In reply to Joseph Mingrone from comment #18) Ah, ok, never mind. Thanks!
Yes, can you do a test build with R built with gfortran and USES=fortran added to the Rstudio port Makefile?
(In reply to Tijl Coosemans from comment #20) No, this will fail. It only works when R is built with flang because of libgcc.so library conflict.
Try it and show me the build error.
Created attachment 187542 [details] gfortran failure log Please see the attached log showing how rstudio fails when math/R is built with gfortran.
(In reply to Yuri Victorovich from comment #23) Thanks. The command is missing the right -rpath so either you forgot to add USES=fortran or the Rstudio build system doesn't respect LDFLAGS somewhere. I'll try to reproduce it.
(In reply to Yuri Victorovich from comment #23) That log shows that ninja is being used which means you didn't add "fortran" to USES like I asked. I tested it myself now and adding "fortran" is enough to make it work with math/R built with gfortran.
(In reply to Tijl Coosemans from comment #25) Tijl, No matter what how do you modify the command or what USES do you add, the core problem that is the conflict between the base and gcc libgcc_s.so will still be there. gfortran requires libgcc_s.so from gcc, and C++ requires the base libgcc_s.so. 2 versions of the same library can't be mapped into the same process. This is a problem for all ports that use both fortran and C++. Yuri
Reassigned to myself.
(In reply to Yuri Victorovich from comment #27) It's great that you get the commit bit. wen
(In reply to Wen Heping from comment #28) Yes, thank you!
(In reply to Yuri Victorovich from comment #26) There should be no problem for clang compiled C++ code to use ports libgcc_s. Such code only uses the _Unwind API of libgcc_s and that is the same between base and ports libgcc_s. Rstudio isn't the first port to combine Fortran and C++. The reason I created Mk/Uses/fortran.mk was to be able to combine clang/clang++ and gfortran. The Fortran support that existed before that implied that gcc/g++ was used. So what problem are you seeing when you add USES=fortran to your Makefile and build math/R with gfortran? Congratulations with your commit bit.
(In reply to Tijl Coosemans from comment #30) > So what problem are you seeing when you add USES=fortran to your Makefile and build math/R with gfortran? Same errors: //usr/local/lib/gcc6/libgfortran.so.3: undefined reference to `__getf2@GCC_4.6.0' etc... > Congratulations with your commit bit. Thank you!
(In reply to Yuri Victorovich from comment #31) Can you provide the actual command and error messages, because here it builds just fine.
Created attachment 187585 [details] rstudio-link-failure.txt (In reply to Tijl Coosemans from comment #32) Attaching the failed command.
(In reply to Yuri Victorovich from comment #33) It contains this: -L/usr/local/flang/lib -lflang -lexecinfo Did you modify Mk/Uses/fortran.mk to make flang the default or something?
(In reply to Tijl Coosemans from comment #34) > Did you modify Mk/Uses/fortran.mk to make flang the default or something? Ah ... yes, I had it modified. You are right, it builds with USES=fortran. However, it fails in the runtime with gfortran: > "TypeError: undefined is not an object (evaluating 'window.desktopHooks.notifyRCrashed')"
(In reply to Yuri Victorovich from comment #35) I managed to get it working with this simple change: sed -i '' 's/RHOME/R_HOME/' /usr/local/lib/rstudio/bin/r-ldpath Without this change the script sets LD_LIBRARY_PATH to "/usr/lib:....." so any subprocess started by rstudio (e.g. rsession) loads the wrong libgcc_s.
Created attachment 188078 [details] shar My current version of RStudio, Question though: Do you happen to know how to add USES only for some ARCH? The way how it is added after .include <bsd.port.pre.mk> doesn't work. Thanks!
It seems to work here. % sudo jexec 12835 sh # uname -a FreeBSD 11i386-default 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386 # cd /usr/ports/devel/rstudio/ # make -VUSES cmake:outsource desktop-file-utils pkgconfig shared-mime-info qmake:_env fortran % s jexec 12837 sh # uname -a FreeBSD 11amd64-default 11.1-RELEASE FreeBSD 11.1-RELEASE #0 r321309: Fri Jul 21 02:08:28 UTC 2017 root@releng2.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 # cd /usr/ports/devel/rstudio # make -VUSES cmake:outsource desktop-file-utils pkgconfig shared-mime-info qmake:_env However, did you see the recent discussions about fortran that I copied you on? The (misleading) subject line was 'svn commit: r452962 - head/math/libRmath'? Also, your .Rhistory is included in the shar, and you should add a space before after the 'USES' block (before CMAKE_ARGS...) to confirm to Chapter 14 of the Porter's Handbook.
The last part should have said: you should add a space after the 'USES' block (before CMAKE_ARGS...) to conform to Chapter 14 of the Porter's Handbook.
(In reply to Joseph Mingrone from comment #38) > It seems to work here. > # make -VUSES Variable gets assigned, but it doesn't take effect. Try adding some non-existent USES (USES=abc fortran): it doesn't fail as it normally does. > Also, your .Rhistory is included in the shar Thanks! This file gets created automatically. > you should add a space after the 'USES' block (before CMAKE_ARGS...) to conform to Chapter 14 of the Porter's Handbook. Thanks! > svn commit: r452962 - head/math/libRmath Sorry, I must have accidentally deleted it. Could you please tell me what was there? > you should add a space after the 'USES' block (before CMAKE_ARGS...) to conform to Chapter 14 of the Porter's Handbook. Ok! --- Jan Beich answered on ports@: the right way is to use .include <bsd.port.options.mk> in this case - then USES works.
Created attachment 188079 [details] shar Now it all works. Re-checking on i386 ...
It sounds like tijl will introduce DEFAULT_VERSIONS=fortran and the default will be gfortran.
(In reply to Joseph Mingrone from comment #42) > It sounds like tijl will introduce DEFAULT_VERSIONS=fortran and the default will be gfortran. I see. Thanks!
I've made the USES=fortran changes. math/R uses gfortran by default on all architectures now, but there's still a FLANG option. If you want to support this option in RStudio you can do something like this: OPTIONS_DEFINE= FLANG FLANG_DESC= Use flang instead of the default Fortran compiler FLANG_USES= fortran:flang FLANG_USES_OFF= fortran
(In reply to Tijl Coosemans from comment #44) Tijl, thanks for letting me know!
A commit references this bug: Author: yuri Date: Sat Dec 2 03:32:19 UTC 2017 New revision: 455332 URL: https://svnweb.freebsd.org/changeset/ports/455332 Log: New port: devel/rstudio: Integrated development environment (IDE) for R PR: 220359 Approved by: tcberner (mentor) Differential Revision: https://reviews.freebsd.org/D13139 Changes: head/devel/Makefile head/devel/RStudio/ head/devel/RStudio/Makefile head/devel/RStudio/distinfo head/devel/RStudio/files/ head/devel/RStudio/files/global-setenv.h head/devel/RStudio/files/patch-CMakeGlobals.txt head/devel/RStudio/files/patch-CMakeLists.txt head/devel/RStudio/files/patch-src_cpp_CMakeLists.txt head/devel/RStudio/files/patch-src_cpp_core_Backtrace.cpp head/devel/RStudio/files/patch-src_cpp_core_CMakeLists.txt head/devel/RStudio/files/patch-src_cpp_core_include_core_r__util_RTokenizer.hpp head/devel/RStudio/files/patch-src_cpp_core_r__util_RSessionContext.cpp head/devel/RStudio/files/patch-src_cpp_core_system_PosixChildProcess.cpp head/devel/RStudio/files/patch-src_cpp_core_system_PosixSched.cpp head/devel/RStudio/files/patch-src_cpp_core_system_PosixSystem.cpp head/devel/RStudio/files/patch-src_cpp_desktop_DesktopMain.cpp head/devel/RStudio/files/patch-src_cpp_server_CMakeLists.txt head/devel/RStudio/files/patch-src_cpp_session_CMakeLists.txt head/devel/RStudio/files/patch-src_cpp_session_SessionHttpMethods.cpp head/devel/RStudio/files/patch-src_cpp_session_session-config.h.in head/devel/RStudio/pkg-descr