ChristianBelloni / complex-bessel-rs

Rust wrapper of the Fortran subroutines developed by D.E. Amos
MIT License
1 stars 1 forks source link

added windows compatibility #1

Closed dizzyi closed 1 year ago

dizzyi commented 1 year ago

Adding Windows compatibility

Why

In Windows, the command program to find the path of a given program is where, not which.

Also, when installing the gfortran the name of the program is gfortran instead of gfortran-13

How

In /build.rs I added compile target platform-specific variable

which is set to platform-specific str,

Then I changed the get_fortran_compiler to replace the hard-coded str with those variables.

And at main, I replaced the command for compiling Fortran code with the platform-specific name

Result

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
ChristianBelloni commented 1 year ago

Thank you so much for taking the time to contribute!

I'll merge this right away and publish a new version in the weekend