Skip to content

Commit

Permalink
Compile libsif with the flag -O3
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Aug 29, 2024
1 parent e04ac95 commit 6dc56b8
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/sifdecoder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,16 @@ function build_libsif(

cd(libsif_folder) do
if isfile("ELFUN$suffix.f")
run(`gfortran -c -fPIC ELFUN$suffix.f`)
object_files = ["ELFUN$suffix.o"]
for file in
("GROUP", "RANGE", "ELFUNF", "ELFUND", "GROUPF", "GROUPD", "SETTYP", "EXTER", "EXTERA")
object_files = String[]
for file in ("ELFUN", "GROUP", "RANGE", "ELFUNF", "ELFUND", "GROUPF", "GROUPD", "SETTYP", "EXTER", "EXTERA")
if isfile("$file$suffix.f")
run(`gfortran -c -fPIC $file$suffix.f`)
@static if Sys.iswindows()
mingw = Int == Int64 ? "mingw64" : "mingw32"
gfortran = joinpath(artifact"mingw-w64", mingw, "bin", "gfortran.exe")
run(`$gfortran -O3 -c -fPIC $file$suffix.f`)
else
run(`gfortran -O3 -c -fPIC $file$suffix.f`)
end
push!(object_files, "$file$suffix.o")
end
end
Expand Down

0 comments on commit 6dc56b8

Please sign in to comment.