Skip to content

Commit

Permalink
chore: make sure R4.4.0 build on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
shun2wang authored and JorisGoosen committed May 10, 2024
1 parent b5e6034 commit 8e5a650
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions Docs/development/jasp-build-guide-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ wget https://github.com/WizardMac/ReadStat/releases/download/v1.1.9/readstat-1.1
tar xvf readstat-1.1.9.tar.gz
cd readstat-1.1.9
export CFLAGS=-Wno-error; export CXXFLAGS=-Wno-error; # I couldnt build 1.1.7 nor 1.1.8 without setting these
autoreconf -i -f
./configure --host=x86_64-ucrt-mingw32 --build=x86_64-ucrt-mingw32
make -j
make install
Expand Down
8 changes: 6 additions & 2 deletions R-Interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,13 @@ if(WIN32)

# This is a variable and it's provided by the main CMakeFiles.txt.
# It is here only if we someone wants to build the R-Interface separately.
if(${R_VERSION} VERSION_GREATER_EQUAL "4.3.0")
if(${R_VERSION} VERSION_GREATER_EQUAL "4.4.0")
set(RTOOLS_PATH
"C:/rtools43/ucrt64"
"C:/rtools44/ucrt64"
CACHE PATH "Path to Rtools44 ucrt64 folder")
elseif(${R_VERSION} VERSION_GREATER_EQUAL "4.3.0")
set(RTOOLS_PATH
"C:/rtools43/ucrt64"
CACHE PATH "Path to Rtools43 ucrt64 folder")
elseif(${R_VERSION} VERSION_GREATER_EQUAL "4.2.0")
set(RTOOLS_PATH
Expand Down
12 changes: 9 additions & 3 deletions Tools/CMake/Programs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,15 @@ if(WIN32)
message(CHECK_PASS "found")
message(STATUS " ${RTOOLS_PATH}")

message(CHECK_START "Looking for Rtools42 legacy")
if(DEFINED RTOOLS42_HOME)
unset(RTOOLS42_HOME)
message(CHECK_START
"Looking for Rtools legacy and auto remove it, if not work please remove such `RTOOLS43_HOME` manually from Windows environment settings."
)
if(DEFINED ENV{RTOOLS42_HOME})
unset(ENV{RTOOLS42_HOME})
elseif(DEFINED ENV{RTOOLS43_HOME})
unset(ENV{RTOOLS43_HOME})
else()
message(CHECK_START "No Rtools legacy found")
endif()


Expand Down
1 change: 1 addition & 0 deletions Tools/CMake/R.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ set(R_BINARY_HASHES

list(APPEND CMAKE_MESSAGE_CONTEXT R)

# dont forget check and upgrande Rtools version if major_minor version changed.
set(R_VERSION "4.4.0")
set(R_VERSION_MAJOR_MINOR "4.4")
set(CURRENT_R_VERSION ${R_VERSION_MAJOR_MINOR})
Expand Down

0 comments on commit 8e5a650

Please sign in to comment.