Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation issues #13

Closed
bijancn opened this issue May 22, 2014 · 4 comments
Closed

Installation issues #13

bijancn opened this issue May 22, 2014 · 4 comments

Comments

@bijancn
Copy link

bijancn commented May 22, 2014

Hi,

I have cloned the git repo and am compiling with gcc (Ubuntu 4.8.2-19ubuntu1). During compilation, I get one warning

In file included from tools.c:54:0:
tools.c: In function ‘TruncateFile’:
form3.h:422:31: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
 #define Utruncate(f) ftruncate(f->descriptor,0);
                               ^
tools.c:1401:3: note: in expansion of macro ‘Utruncate’
   Utruncate(f);
   ^

Probably unrelated, when I try to make check, I get

/bin/bash:1: Invalid char `\x7F' in expression
/bin/bash:1: Invalid char `\x02' in expression
/bin/bash:1: Invalid char `\x01' in expression
/bin/bash:1: Invalid char `\x01' in expression
/bin/bash:1:in `<main>': uninitialized constant ELF (NameError)
make[3]: *** [form.rb.log] Error 1
make[3]: Leaving directory `/home/bijancn/form/check'
make[2]: *** [check-TESTS] Error 2

Trying to make manual.pdf, I stumpled upon a problem with manualdate.tex. With my locale I get 22 Mai 2014 with date +"%d %b %Y" which is not accepted by date -d ('invalid date'). A quick fix that allowed me to build the manual was to use date -I (ISO format) instead of date +"%d %b %Y" in the Makefile.am. Maybe you want to use this.

When I try a trivial example, it seems to run fine, except I get

    Format 03;
 ... Too small value for linesize corrected to 39
    #optimize expr
    Print;
    .end

This might be connected to the failed make check? I could only trace this problem to FG.cTable but I don't know how to fix it. I have plenty of space for windows so a linesize of 39 looks quite annoying.

@tueda
Copy link
Collaborator

tueda commented May 22, 2014

Thank you for your reporting.

About the -Wunused-result warning, in principle the return-value should be checked, although what we can do when ftruncate failed is just printing some error message and terminating the program. Usually it works without error checkings unless some severe IO problems occur (e.g., disk error).

For the make check problem, I confirmed the same problem occurs also in my environment (openSUSE 13.1). More investigation is needed.

About the manualdate.tex problem, I would use LC_TIME=C date to ensure the output format is always like 22 May 2014, because -I option is not in the POSIX specification, http://pubs.opengroup.org/onlinepubs/009695399/utilities/date.html. (But -d is also not in the POSIX....)

The last one is easy to answer. You should use Format O3 (capital O), not Format 03 (zero). If you use the latter, it means the line size in the output should be 3, so FORM complained 3 is too small and corrected it to 39.

@bijancn
Copy link
Author

bijancn commented May 22, 2014

Thanks a lot for the quick answer. That clears things up for me. I leave it to you, when you want to close the issue.

tueda added a commit that referenced this issue May 26, 2014
"unused-result" warning for calling ftruncate() in Utruncate(). (#13)
NOTE: TruncateFile() is not called from anywhere.

"maybe-uninitialized" warning in PreRandom() on ParFORM.
tueda added a commit that referenced this issue May 28, 2014
Remove the code that was used for determining the OS, because newer
rubies warn the usage of deprecated Config. The information of the OS is
actually not used anywhere.

Fix the result for examples.rb:Sec_3_44_2. Now #write "%e" doesn't
output an extra blank line. (It was changed by 44cf65f.)

NOTE: For automake >= 1.13, "serial-tests" option has to be added in
AM_INIT_AUTOMAKE in configure.ac:

  AM_INIT_AUTOMAKE([foreign 1.7 dist-bzip2 serial-tests])

otherwise "make check" causes errors (#13), while adding "serial-tests"
causes an error at running automake < 1.12.
@tueda
Copy link
Collaborator

tueda commented May 28, 2014

I found the make check problem is caused by automake >= 1.13. The following is a somewhat technical detail and you may jump to the last paragraph.

In automake >= 1.13, the default behaviour of the test suite was changed in an incompatible way (a parallel test harness). I prefer a serial test harness (because of its output behaviour and there is only one test program form.rb to be executed, i.e., a parallel test harness doesn't lead any parallelization in our test suite), so a simple workaround is adding serial-tests option in AM_INIT_AUTOMAKE. It resolves the problem in automake >= 1.13, but in automake < 1.12 serial-tests is not available and causes another error.

To use serial-tests with keeping backwards compatibility, I tried m4_ifndef([AM_PROG_INSTALL], [serial-tests]) and m4_ifdef([AM_EXTRA_RECURSIVE_TARGETS], [serial-tests]) found in https://lists.gnu.org/archive/html/automake/2013-01/msg00052.html and http://www.memoryhole.net/kyle/2014/01/automake_113s_parallel_harness.html, respectively, but both seem not to work in my environment.

An alternative way is check automake --version by m4_esyscmd as https://www.redhat.com/archives/libguestfs/2013-February/msg00102.html, but I don't like to do that because the command name of automake can differ from automake. (And I can't find a way to get the automake command name in the m4-layer.)

As a consequence, a workaround for now is adding serial-tests option in AM_INIT_AUTOMAKE in configure.ac manually if you use automake >= 1.13:

AM_INIT_AUTOMAKE([foreign 1.7 dist-bzip2 serial-tests])

(By the way, my commit 3d69423 is a fix of make check about other stuff.)

tueda added a commit that referenced this issue Jun 3, 2014
It resolves the "make check" issue of #13 in most cases.
tueda added a commit that referenced this issue Jun 10, 2014
A new script gendate.sh is introduced for generating date strings for C
and LaTeX, production-date.h, manualdate.tex and devrefdate.tex.

It also resolves the "date -d (invalid date)" issue of #13.
@tueda
Copy link
Collaborator

tueda commented Jun 10, 2014

All the problems here were resolved at least for typical environments, so I close the issue.

@tueda tueda closed this as completed Jun 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants