Skip to content

Commit 4760fb3

Browse files
committed
Use MPFI in Web, use upstream version @40012
1 parent 4c2b37a commit 4760fb3

File tree

5 files changed

+384
-17
lines changed

5 files changed

+384
-17
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ include_directories(src/giac/headers)
254254

255255
add_definitions(-DHAVE_NO_HOME_DIRECTORY -DGIAC_GGB -DIN_GIAC -DHAVE_LIB_PTHREAD
256256
-DGIAC_GENERIC_CONSTANTS -DTIMEOUT
257-
-DHAVE_LIBMPFR -DVERSION="1.2.3") # Version number seems hardwired, FIXME.
257+
-DHAVE_LIBMPFR -DVERSION="1.9.0") # Version number seems hardwired, FIXME.
258258

259259
add_executable(minigiac
260260
${GIAC_SOURCES}

build.gradle

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,20 +64,13 @@ def emgiacSourceDir = "$externalSourceDir/emgiac"
6464

6565
def jsPrebuiltDir = "src/giac.js/prebuilt"
6666
def LlvmMpfrA = "$jsPrebuiltDir/libmpfr.a"
67+
def LlvmMpfiA = "$jsPrebuiltDir/libmpfi.a"
6768
def LlvmGmpA = "$jsPrebuiltDir/libgmp.a"
68-
if (System.env['EXT_GMPMPFR'] != null && System.env['EXT_GMPMPFR'] == "local") {
69-
LlvmMpfrA = "$mpfrSourceDir/src/.libs/libmpfr.a"
70-
LlvmGmpA = "$gmpSourceDir/.libs/libgmp.a"
71-
}
72-
if (System.env['EXT_GMPMPFR'] != null && System.env['EXT_GMPMPFR'] == "emgiac") {
73-
LlvmMpfrA = "$emgiacSourceDir/giac/libmpfr.a"
74-
LlvmGmpA = "$emgiacSourceDir/giac/libgmp.a"
75-
}
7669

7770
def emsdkDir = file('emsdk')
7871
def emsdkRunDir = file("$emsdkDir")
7972

80-
def emscriptenVersion = 'tag-3.1.18'
73+
def emscriptenVersion = 'tag-3.1.41'
8174
if (System.env['EMSCRIPTEN_VERSION'] != null) {
8275
emscriptenVersion = System.env['EMSCRIPTEN_VERSION']
8376
}
@@ -88,7 +81,7 @@ def emccCommand = "${emscriptenDir}/emcc"
8881
// End of emscripten related settings. Huh.
8982
def java_home = org.gradle.internal.jvm.Jvm.current().javaHome
9083
ext.ggrev = project.findProperty("revision") ?: "SNAPSHOT"
91-
def giacVersion = '"1.2.4-' + ggrev + '"'
84+
def giacVersion = '"1.9.0-' + ggrev + '"'
9285
println giacVersion
9386
import org.apache.tools.ant.taskdefs.condition.Os
9487
def isMac = Os.isFamily(Os.FAMILY_MAC)
@@ -934,12 +927,12 @@ tasks.addRule("Pattern: emccCompileWasm_<FILE>Cc: Compile <FILE>.cc into <FILE>.
934927
def commandline = emccCommand
935928
commandline += ' -DIN_GIAC -DGIAC_GENERIC_CONSTANTS -DHAVE_CONFIG_H -DNO_STDEXCEPT -fno-exceptions' // from old Makefile
936929
commandline += ' -DVERSION=' + giacVersion
937-
commandline += " -Dgammaf=tgammaf -s ALLOW_MEMORY_GROWTH=1"
930+
commandline += " -Dgammaf=tgammaf -s ALLOW_MEMORY_GROWTH=1 -std=gnu++14"
938931
commandline += " -s WASM=1 -s NO_EXIT_RUNTIME=1"
939932
commandline += " -s PRECISE_I64_MATH=1 -Oz" // new setting
940933
commandline += " -DHAVE_UNISTD_H"
941934
commandline += ' -DGIAC_GGB' // from old Makefile
942-
commandline += ' -DTIMEOUT -DEMCC2 ' // from old config.h
935+
commandline += ' -DTIMEOUT -DEMCC2 -DHAVE_LIBMPFI' // from old config.h
943936
commandline += " -Isrc/giac/headers -c $input -o $output"
944937
println "Compiling: ${commandline}"
945938
commandLine commandline.split()
@@ -988,11 +981,12 @@ task emccGiacJsWasm(dependsOn: 'emccCompileWasm') {
988981

989982
file(binaryJsDir).mkdirs()
990983
exec {
984+
linkerArgs << LlvmMpfiA
991985
linkerArgs << LlvmMpfrA // mpfr must precede gmp, see http://www.mpfr.org/faq.html, Q5
992986
linkerArgs << LlvmGmpA
993987
linkerArgs << '--js-library' << 'src/giac.js/js/time.js'
994988

995-
linkerArgs << '-DGIAC_GGB'
989+
linkerArgs << '-DGIAC_GGB' << "-std=gnu++14"
996990
linkerArgs << '-o' << output
997991
// linkerArgs << "-s" << "DISABLE_EXCEPTION_CATCHING=0"
998992
linkerArgs << '-Oz' << '-v' << '-s' << "EXPORTED_FUNCTIONS=['_caseval']"

src/giac.js/prebuilt/libmpfi.a

493 KB
Binary file not shown.

src/giac/headers/config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@
2020

2121
/* Define to the full name and version of this package. */
2222
#ifndef PACKAGE_STRING
23-
#define PACKAGE_STRING "giac 1.2.3"
23+
#define PACKAGE_STRING "giac 1.9.0"
2424
#endif
2525

2626
/* Define to the one symbol short name of this package. */
2727
#define PACKAGE_TARNAME "giac"
2828

2929
/* Define to the version of this package. */
3030
#ifndef PACKAGE_VERSION
31-
#define PACKAGE_VERSION "1.2.3"
31+
#define PACKAGE_VERSION "1.9.0"
3232
#endif
3333

3434
/* Version number of package */
3535
#ifndef VERSION
36-
#define VERSION "1.2.3"
36+
#define VERSION "1.9.0"
3737
#endif
3838

3939
#define GIAC_NO_OPTIMIZATIONS

0 commit comments

Comments
 (0)