Closed dizzyi closed 1 year ago
In Windows, the command program to find the path of a given program is where, not which.
where
which
Also, when installing the gfortran the name of the program is gfortran instead of gfortran-13
gfortran
gfortran-13
In /build.rs I added compile target platform-specific variable
/build.rs
static PATH_FINDER_COMMAND: &str
static GFORTRAN_NAME : &str
which is set to platform-specific str,
Then I changed the get_fortran_compiler to replace the hard-coded str with those variables.
get_fortran_compiler
str
And at main, I replaced the command for compiling Fortran code with the platform-specific name
main
Can build on Windows machine now, well it works on my machine
PS ..\complex-bessel-rs> cargo build Compiling num-traits v0.2.16 Compiling num-integer v0.1.45 Compiling num-complex v0.4.4 Compiling num-bigint v0.4.4 Compiling num-iter v0.1.43 Compiling num-rational v0.4.1 Compiling num v0.4.1 Compiling complex-bessel-rs v0.0.5 (..\complex-bessel-rs) Finished dev [unoptimized + debuginfo] target(s) in 3.47s
Thank you so much for taking the time to contribute!
I'll merge this right away and publish a new version in the weekend
Adding Windows compatibility
Why
In Windows, the command program to find the path of a given program is
where
, notwhich
.Also, when installing the
gfortran
the name of the program isgfortran
instead ofgfortran-13
How
In
/build.rs
I added compile target platform-specific variablestatic PATH_FINDER_COMMAND: &str
, andstatic GFORTRAN_NAME : &str
which is set to platform-specific str,
Then I changed the
get_fortran_compiler
to replace the hard-codedstr
with those variables.And at
main
, I replaced the command for compiling Fortran code with the platform-specific nameResult
Can build on Windows machine now, well it works on my machine