saezlab / CARNIVAL

CAusal Reasoning for Network Identification with integer VALue programming in R
https://saezlab.github.io/CARNIVAL/
57 stars 29 forks source link

Windows linux support #5

Closed ptrairatphisan closed 5 years ago

ptrairatphisan commented 5 years ago

An issue on running CARNIVAL on Windows was reported by our collaborator, Lauren M, on Feb 4th, 2019.

After the investigation, I discovered that there is an issue with the path on Windows which are differed in R/RStudio (using slash to separate directories) versus on command prompt (using backslash to separate directories) and this causes an issue when invoking interactive Cplex with the function "system()" inside R.

There is a way to bypass the backslash symbol but it doesn't work properly in the CARNIVAL framework. An easy quick fix would be to temporary copy the file 'cplex.exe' from the CplexPath variable to the current path -> run optimisation -> then remove the file. Now the runCARNIVAL script will automatically check for the operating system of the machine and will apply the corresponding script to execute the job. The pipeline was also tested successfully on Linux (running on Ubuntu 18.04)

Note: The runCARNIVAL function could also now output the results directly as an R variable for further analyses (issue raised by Aurélien D. and implemented by Enio G.). A few other updates and fixes are included in this pull request.

enio23 commented 5 years ago

It works like magic