Thread: Re: Building on FreeBSD 12

Started: 2019-12-01 13:46:03
Last activity: 2019-12-01 20:44:36
Topics: SAC Help
Jonathan
2019-12-01 13:46:03
Hi Brian,

That did the trick. I used ./configure --enable-readline and it used
-lreadline. It got me much further. Now, it looks like there is a function
in sss/xtraveltime.c already contained in stdio.h conflicting:

gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include
-D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o
sss/xtraveltime.c
sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
truncate(char *s) {
^~~~~~~~
In file included from sss/xtraveltime.c:2:
/usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was
here
int truncate(const char *, __off_t);
^~~~~~~~
*** Error code 1

Just to test, I commented out that include and I got this:

gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include
-D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o
sss/xtraveltime.c
sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
truncate(char *s) {
^~~~~~~~
In file included from ../inc/sss.h:11,
from sss/xtraveltime.c:7:
/usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was
here
int truncate(const char *, __off_t);
^~~~~~~~
*** Error code 1

Commenting iut the include in inc/sss.h resulted in:

gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include
-D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o
sss/xtraveltime.c
In file included from sss/xtraveltime.c:7:
../inc/sss.h:328:17: error: unknown type name 'FILE'
void readtaup ( FILE *taupfile , int *ncurves , int *nerr);
^~~~
../inc/sss.h:328:17: note: 'FILE' is defined in header '<stdio.h>'; did
you forget to '#include <stdio.h>'?
../inc/sss.h:14:1:
+#include <stdio.h>

../inc/sss.h:328:17:
void readtaup ( FILE *taupfile , int *ncurves , int *nerr);
^~~~
sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
truncate(char *s) {
^~~~~~~~
In file included from ../inc/string_utils.h:33,
from ../inc/debug.h:3,
from ../inc/amf.h:12,
from sss/xtraveltime.c:11:
/usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was
here
int truncate(const char *, __off_t);
^~~~~~~~

So it looks like this funcion is used in these header files too. I'm not
sure how to fix this. How do you think I should proceed?

Thanks again.

Jonathan

On Sun, 1 Dec 2019, Brian Savage wrote:

Date: Sun, 1 Dec 2019 10:28:56 -0500
From: Brian Savage <savage<at>uri.edu>
To: Jonathan <emuman100<at>gmail.com>
Subject: Re: [IRIS][sac-help] Building on FreeBSD 12

Jonathan,

If you turn off the edit line library, or use the version provided with FreeBSD that would be a workaround.

I think doing something like
% ./configure ?enable-readline
should work, or
% ./configure ?disable-editline

The editline lib is originally from NetBSD, so there is a good possibility it should work,

Brian


On Nov 27, 2019, at 5:34 PM, Jonathan <emuman100<at>gmail.com> wrote:

Hi All,

I'm on FreeBSD 12 using gcc8. I'm receiving some errors during compile
that might be due to changes in gcc8 from pervious versions. It might be
an old version of libedit with gcc8 causing the issue:

gcc -DHAVE_CONFIG_H -I. -I.. -O -Wall -pipe -g3 -c vi.c
vi.c:920:74: error: macro "__weak_reference" requires 2 arguments, but
only 1 given
extern char *get_alias_text(const char *)
__weak_reference(get_alias_text);

^
vi.c: In function 'get_alias_text':
vi.c:920:43: error: expected declaration specifiers before
'__weak_reference'
extern char *get_alias_text(const char *)
__weak_reference(get_alias_text);
^~~~~~~~~~~~~~~~
vi.c:925:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'{' token
{
^
vi.c:955:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
'{' token
{
^
vi.c:1000:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '{' token
{
^
vi.c:1057:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '{' token
{
^
vi.c:1106:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '{' token
{
^
vi.c:920:29: error: parameter name omitted
extern char *get_alias_text(const char *)
__weak_reference(get_alias_text);
^~~~~~~~~~~~
vi.c:1127: error: expected '{' at end of input
}

Thanks

Jonathan


----------------------
SAC Help
Topic home: https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_message-2Dcenter_topic_sac-2Dhelp_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=zfmAvCJO__qocvBlGIIz7EklWPI7S9yQtcggX89rmn8&e= | Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

Sent from the IRIS Message Center (https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_message-2Dcenter_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=IC3HM2Qm-E-vUZhyA__xzSNzasYwhVmZ1F_--tSvMk4&e= )
Update subscription preferences at https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_account_profile_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=zxwryZc8Ng817AKtxSExh98_6Smv0r6FBCqCNb7QlQI&e=



  • Brian Savage
    2019-12-01 14:32:53
    Jonathan

    Rename truncate() to sac_truncate(). There are a couple places (2?) in the src/sss/xtraveltime.c that need to be renamed.

    Brian


    On Dec 1, 2019, at 1:46 PM, Jonathan <emuman100<at>gmail.com> wrote:

    Hi Brian,

    That did the trick. I used ./configure --enable-readline and it used -lreadline. It got me much further. Now, it looks like there is a function in sss/xtraveltime.c already contained in stdio.h conflicting:

    gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include -D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o sss/xtraveltime.c
    sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
    truncate(char *s) {
    ^~~~~~~~
    In file included from sss/xtraveltime.c:2:
    /usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was here
    int truncate(const char *, __off_t);
    ^~~~~~~~
    *** Error code 1

    Just to test, I commented out that include and I got this:

    gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include -D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o sss/xtraveltime.c
    sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
    truncate(char *s) {
    ^~~~~~~~
    In file included from ../inc/sss.h:11,
    from sss/xtraveltime.c:7:
    /usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was here
    int truncate(const char *, __off_t);
    ^~~~~~~~
    *** Error code 1

    Commenting iut the include in inc/sss.h resulted in:

    gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include -D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o sss/xtraveltime.c
    In file included from sss/xtraveltime.c:7:
    ../inc/sss.h:328:17: error: unknown type name 'FILE'
    void readtaup ( FILE *taupfile , int *ncurves , int *nerr);
    ^~~~
    ../inc/sss.h:328:17: note: 'FILE' is defined in header '<stdio.h>'; did you forget to '#include <stdio.h>'?
    ../inc/sss.h:14:1:
    +#include <stdio.h>

    ../inc/sss.h:328:17:
    void readtaup ( FILE *taupfile , int *ncurves , int *nerr);
    ^~~~
    sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
    truncate(char *s) {
    ^~~~~~~~
    In file included from ../inc/string_utils.h:33,
    from ../inc/debug.h:3,
    from ../inc/amf.h:12,
    from sss/xtraveltime.c:11:
    /usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was here
    int truncate(const char *, __off_t);
    ^~~~~~~~

    So it looks like this funcion is used in these header files too. I'm not sure how to fix this. How do you think I should proceed?

    Thanks again.

    Jonathan

    On Sun, 1 Dec 2019, Brian Savage wrote:

    Date: Sun, 1 Dec 2019 10:28:56 -0500
    From: Brian Savage <savage<at>uri.edu>
    To: Jonathan <emuman100<at>gmail.com>
    Subject: Re: [IRIS][sac-help] Building on FreeBSD 12
    Jonathan,

    If you turn off the edit line library, or use the version provided with FreeBSD that would be a workaround.

    I think doing something like
    % ./configure ?enable-readline
    should work, or
    % ./configure ?disable-editline

    The editline lib is originally from NetBSD, so there is a good possibility it should work,

    Brian


    On Nov 27, 2019, at 5:34 PM, Jonathan <emuman100<at>gmail.com> wrote:

    Hi All,

    I'm on FreeBSD 12 using gcc8. I'm receiving some errors during compile
    that might be due to changes in gcc8 from pervious versions. It might be
    an old version of libedit with gcc8 causing the issue:

    gcc -DHAVE_CONFIG_H -I. -I.. -O -Wall -pipe -g3 -c vi.c
    vi.c:920:74: error: macro "__weak_reference" requires 2 arguments, but
    only 1 given
    extern char *get_alias_text(const char *)
    __weak_reference(get_alias_text);

    ^
    vi.c: In function 'get_alias_text':
    vi.c:920:43: error: expected declaration specifiers before
    '__weak_reference'
    extern char *get_alias_text(const char *)
    __weak_reference(get_alias_text);
    ^~~~~~~~~~~~~~~~
    vi.c:925:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
    '{' token
    {
    ^
    vi.c:955:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
    '{' token
    {
    ^
    vi.c:1000:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
    before '{' token
    {
    ^
    vi.c:1057:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
    before '{' token
    {
    ^
    vi.c:1106:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
    before '{' token
    {
    ^
    vi.c:920:29: error: parameter name omitted
    extern char *get_alias_text(const char *)
    __weak_reference(get_alias_text);
    ^~~~~~~~~~~~
    vi.c:1127: error: expected '{' at end of input
    }

    Thanks

    Jonathan


    ----------------------
    SAC Help
    Topic home: https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_message-2Dcenter_topic_sac-2Dhelp_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=zfmAvCJO__qocvBlGIIz7EklWPI7S9yQtcggX89rmn8&e= | Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

    Sent from the IRIS Message Center (https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_message-2Dcenter_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=IC3HM2Qm-E-vUZhyA__xzSNzasYwhVmZ1F_--tSvMk4&e= )
    Update subscription preferences at https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_account_profile_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=zxwryZc8Ng817AKtxSExh98_6Smv0r6FBCqCNb7QlQI&e=





    • Jonathan
      2019-12-01 20:44:36
      Hi Brian,

      That also did the trick! I was able to get get it compiled, installed, and
      running!

      Thank you for the help!

      Jonathan


      On Sun, 1 Dec 2019, Brian Savage wrote:

      Date: Sun, 1 Dec 2019 14:32:53 -0500
      From: Brian Savage <savage<at>uri.edu>
      To: Jonathan <emuman100<at>gmail.com>
      Cc: sac-help<at>lists.ds.iris.edu
      Subject: Re: [IRIS][sac-help] Building on FreeBSD 12

      Jonathan

      Rename truncate() to sac_truncate(). There are a couple places (2?) in the src/sss/xtraveltime.c that need to be renamed.

      Brian


      On Dec 1, 2019, at 1:46 PM, Jonathan <emuman100<at>gmail.com> wrote:

      Hi Brian,

      That did the trick. I used ./configure --enable-readline and it used -lreadline. It got me much further. Now, it looks like there is a function in sss/xtraveltime.c already contained in stdio.h conflicting:

      gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include -D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o sss/xtraveltime.c
      sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
      truncate(char *s) {
      ^~~~~~~~
      In file included from sss/xtraveltime.c:2:
      /usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was here
      int truncate(const char *, __off_t);
      ^~~~~~~~
      *** Error code 1

      Just to test, I commented out that include and I got this:

      gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include -D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o sss/xtraveltime.c
      sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
      truncate(char *s) {
      ^~~~~~~~
      In file included from ../inc/sss.h:11,
      from sss/xtraveltime.c:7:
      /usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was here
      int truncate(const char *, __off_t);
      ^~~~~~~~
      *** Error code 1

      Commenting iut the include in inc/sss.h resulted in:

      gcc -DHAVE_CONFIG_H -I. -I../inc -I/usr/local/include -D_THREAD_SAFE -pthread -I../inc -c -o sss/xtraveltime.o sss/xtraveltime.c
      In file included from sss/xtraveltime.c:7:
      ../inc/sss.h:328:17: error: unknown type name 'FILE'
      void readtaup ( FILE *taupfile , int *ncurves , int *nerr);
      ^~~~
      ../inc/sss.h:328:17: note: 'FILE' is defined in header '<stdio.h>'; did you forget to '#include <stdio.h>'?
      ../inc/sss.h:14:1:
      +#include <stdio.h>

      ../inc/sss.h:328:17:
      void readtaup ( FILE *taupfile , int *ncurves , int *nerr);
      ^~~~
      sss/xtraveltime.c:31:1: error: conflicting types for 'truncate'
      truncate(char *s) {
      ^~~~~~~~
      In file included from ../inc/string_utils.h:33,
      from ../inc/debug.h:3,
      from ../inc/amf.h:12,
      from sss/xtraveltime.c:11:
      /usr/include/stdio.h:441:6: note: previous declaration of 'truncate' was here
      int truncate(const char *, __off_t);
      ^~~~~~~~

      So it looks like this funcion is used in these header files too. I'm not sure how to fix this. How do you think I should proceed?

      Thanks again.

      Jonathan

      On Sun, 1 Dec 2019, Brian Savage wrote:

      Date: Sun, 1 Dec 2019 10:28:56 -0500
      From: Brian Savage <savage<at>uri.edu>
      To: Jonathan <emuman100<at>gmail.com>
      Subject: Re: [IRIS][sac-help] Building on FreeBSD 12
      Jonathan,

      If you turn off the edit line library, or use the version provided with FreeBSD that would be a workaround.

      I think doing something like
      % ./configure ?enable-readline
      should work, or
      % ./configure ?disable-editline

      The editline lib is originally from NetBSD, so there is a good possibility it should work,

      Brian


      On Nov 27, 2019, at 5:34 PM, Jonathan <emuman100<at>gmail.com> wrote:

      Hi All,

      I'm on FreeBSD 12 using gcc8. I'm receiving some errors during compile
      that might be due to changes in gcc8 from pervious versions. It might be
      an old version of libedit with gcc8 causing the issue:

      gcc -DHAVE_CONFIG_H -I. -I.. -O -Wall -pipe -g3 -c vi.c
      vi.c:920:74: error: macro "__weak_reference" requires 2 arguments, but
      only 1 given
      extern char *get_alias_text(const char *)
      __weak_reference(get_alias_text);

      ^
      vi.c: In function 'get_alias_text':
      vi.c:920:43: error: expected declaration specifiers before
      '__weak_reference'
      extern char *get_alias_text(const char *)
      __weak_reference(get_alias_text);
      ^~~~~~~~~~~~~~~~
      vi.c:925:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
      '{' token
      {
      ^
      vi.c:955:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before
      '{' token
      {
      ^
      vi.c:1000:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
      before '{' token
      {
      ^
      vi.c:1057:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
      before '{' token
      {
      ^
      vi.c:1106:1: error: expected '=', ',', ';', 'asm' or '__attribute__'
      before '{' token
      {
      ^
      vi.c:920:29: error: parameter name omitted
      extern char *get_alias_text(const char *)
      __weak_reference(get_alias_text);
      ^~~~~~~~~~~~
      vi.c:1127: error: expected '{' at end of input
      }

      Thanks

      Jonathan


      ----------------------
      SAC Help
      Topic home: https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_message-2Dcenter_topic_sac-2Dhelp_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=zfmAvCJO__qocvBlGIIz7EklWPI7S9yQtcggX89rmn8&e= | Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

      Sent from the IRIS Message Center (https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_message-2Dcenter_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=IC3HM2Qm-E-vUZhyA__xzSNzasYwhVmZ1F_--tSvMk4&e= )
      Update subscription preferences at https://urldefense.proofpoint.com/v2/url?u=http-3A__ds.iris.edu_account_profile_&d=DwICAg&c=dWz0sRZOjEnYSN4E4J0dug&r=xlrnQuY_RWoRIvnCDJ5AfQ&m=Wbq8zYg6O4fQ0ZXd1O4fXu6mmZNdNR3GCPwJGEwW8Mk&s=zxwryZc8Ng817AKtxSExh98_6Smv0r6FBCqCNb7QlQI&e=





Page built 04:25:41 | v.b'59d0d2