Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

f2c header file customization when building OpenModelica from source

f2c header file customization when building OpenModelica from source

I have been building OpenModelica for a while on Linux with x86_64 architecture. Although the build is successful, I run into run time errors during solver phase which were traced to improper typedefs in f2c.h.  I noticed that some how the config and make files generated do not make  the necessary (changes to f2c.h ... replacing  "long long" to "long" for 64bit machine).

Once I followed the README instructions in f2clib source tree as to how to massage the f2c.h,   before building OpenModelica things work fine.  My earlier post related DASSL solver crashing on all examples is also related to this. I am not sure if OS on similar architecture have issues similar to this.


Perhaps there exists a case for making the build process more robust either by waning the users of  the need to customize f2c.h for specific architecture or automating changes through make. Otherwise, novice users will have difficulty tracking down as to why the models fail during execution, even though build process completed well.

Re: f2c header file customization when building OpenModelica from source

We already do build libf2c in the makefiles, and we create the arith executable, which generates arith.h. What did not work using that process. What did you change? Also, https://trac.openmodelica.org/OpenModelica/newticket is the correct forum for build processes (these forum threads get lost because they don't show up as open in trac).

Re: f2c header file customization when building OpenModelica from source

Thanks for the prompt response. Yes ... I will add it to the bug tracker. But it was down. I am eager to know if others had issues like this.

Anyway, attached find the orignial f2c.h in the repository versus the one I tweaked.  Unfortunately I can't upload files through this form but here is the diff output between the f2c.h (I tweaked) and the original f2c.h. (output in column mode). I am behind a firewall which does not allow upload of files.

.... Scroll down to see the table below .....


              f2c.h (modified)                            f2c.h (original)
#if defined(__alpha__) || defined(__sparc64__) || defined(__x <
typedef int integer;                        < 
typedef unsigned int uinteger;       <
#else                                  <
#endif                                  <
#if defined(__alpha__) || defined(__sparc64__) || defined(__x <
typedef int logical;                          <
#else                                  <
#endif                                  <
#if defined(__alpha__) || defined(__sparc64__) || defined(__x |typedef long long longint;        /* system-dependent *
typedef long longint;    /* system-dependent */              |typedef unsigned long long ulongint;    /* system-dependent *
typedef unsigned long ulongint;  /* system-dependent */          <
#else                                  <
typedef long long longint;              /* system-dependent - <
typedef unsigned long long ulongint;    /* system-dependent - <
#endif                                  <
#if defined(__alpha__) || defined(__sparc64__) || defined(__x <
typedef int flag;                          <
typedef int ftnlen;                          <
typedef int ftnint;                          <
#else                                  <
#endif                                  <
#ifndef __cplusplus                          <
#endif   

There are 0 guests and 0 other users also viewing this topic
You are here: