<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#CCCCCC" text="#000000">
<p><font size="+1">Hi Andras,</font></p>
<p><font size="+1">Thanks for your information ! :)<br>
</font></p>
<p><font size="+1">Thanks for the list of minimal features (SMP, 64bit, SSL). Once I'm done with running correctly the tests with the minimal case I have now, I'll move forward and I will enable them. For now, I'm using :
</font><font size="+1"><tt>--disable-hipe --disable-threads --disable-smp-support --without-javac</tt></font><font size="+1"> . And that already does not work since tests fail at beginning.<br>
</font></p>
<p><font size="+1">About the assembler issue with 1: labels, my colleague already provided me with a solution, but more complex than yours. I've asked him to explain me what the impact is to use his solution or yours.</font></p>
<p><font size="+1"><b>HIPE</b>: OK. I'll go back to it later.</font></p>
<p><font size="+1"><b>SMP</b>: As I said, I have changed some parts of the assembler, including the</font><font size="+1"> erts/include/internal/ppc32/atomic.h file. However, I have no idea if my changes are correct... since I'm now not using SMP. I'll see
at the 2 pages you have provided, [1] & [2] .<br>
</font></p>
<p><font size="+1">About "scheduler binding", I'll have to check that the way I build Erlang (by means of a FedoraCore25 modified .spec file) does generate all the appropriate flags. For now, I am in 32bit. For now, I see that some configure and Makefile (erts/emulator/powerpc-ibm-aix6.1/Makefile)
files contain : </font><font size="+1"><tt>DEXPORT = -Wl,-bexpall,-brtl</tt></font><font size="+1"> . However, I do not see them in the traces of the build. However, "make" command hides the details. -b64 and -maix64 should come when I am in 64bit. I'll check.</font></p>
<p><font size="+1">Though I've been able to build Erlang till the end, the traces do not show any "</font><font size="+1">./otp_build configure". However, as I said, "make" only shows a summary of what it does. And the --trace option is much too verbose.</font></p>
<p><font size="+1"><b>Ap</b><b>plications</b>: it looks that 38 applications where built:
<i>asn1 compiler cosEvent cosEventDomain cosFileTransfer cosNotification cosProperty cosTime cosTransactions crypto diameter edoc eldap erl_docgen erl_interface eunit gs hipe ic inets kernel mnesia odbc orber os_mon otp_mibs parsetools percept public_key runtime_tools
sasl snmp ssh ssl stdlib syntax_tools tools xmerl</i><br>
Any important application missing ?</font></p>
<p><font size="+1"><b>OTHER:</b><br>
</font></p>
<p><font size="+1">-D</font><font size="+1">_LINUX_SOURCE_COMPAT : YEs !! For sure. We use it sometimes. And I forgot to try with it. I'm rebuilding now with it. Bad news: I see no improvement for my test crash.<br>
</font></p>
<p><font size="+1">- </font><font size="+1">clock/time handling issues ? OK. I'll think of this when looking at issues.</font></p>
<p><font size="+1">- </font><font size="+1">vsyslog : I've temporaly worked-around this. I'll go back to it later.</font></p>
<p><font size="+1">- OpenSSL & src.rpm : Yes. We deliver always (or nearly always) the <package>.src.rpm file on BullFreeware.</font></p>
<p><b><font size="+1">BASIC TESTING:</font></b></p>
<p><font size="+1"># erl<br>
Erlang/OTP 19 [erts-8.2] [source]<br>
Eshell V8.2 (abort with ^G)<br>
1> :) That begins to work ! :)<br>
</font></p>
<p><font size="+1">- SMP & core/thread number: since, for now, I'm building without SMP, I'll check this later.</font></p>
<p><font size="+1">- Binding schedulers: I'll go back to this later.</font></p>
<p><font size="+1">- erl > crypto:start() : OK : will check. Done:<br>
2> crypto:start().<br>
ok<br>
</font></p>
<p><font size="+1">- 3> erlang:system_info(cpu_topology).<br>
undefined<br>
(No SMP yet)<br>
</font></p>
<p><font size="+1">-</font><font size="+1"> test suites for the emulator. Hummm I've been able to find some instructions for running tests. No idea for now if these tests include the emulator. I'll look at this once by re-building of Erlang is done.*</font></p>
<p><font size="+1">- # ./otp_build tests : Looks like there is a mismatch in the naming:
<br>
Makefile:248: /opt/freeware/src/packages/BUILD/otp_src_19.2/make/powerpc-ibm-aix6.1<b>.9.0</b>/otp_ded.mk: No such file or directory<br>
<br>
# find . -name otp_ded.mk<br>
./make/powerpc-ibm-aix6.1/otp_ded.mk<br>
# ln -s /opt/freeware/src/packages/BUILD/otp_src_19.2/make/powerpc-ibm-aix6.1 /opt/freeware/src/packages/BUILD/otp_src_19.2/make/powerpc-ibm-aix6.1.9.0</font></p>
<p><font size="+1"> With this symlink, the ./otp_build tests command works fine, doing a lot of things, and ending without error message. However, then:<br>
# cd release/tests/test_server<br>
# erl<br>
...<br>
1> ts:install().<br>
Running /opt/freeware/src/packages/BUILD/otp_src_19.2/release/tests/test_server/configure
<br>
Env: []<br>
configure: error: cannot find sources (conf_vars.in) in /opt/freeware/src/packages/BUILD/otp_src_19.2/release/tests/test_server or ..<br>
{error,enoent}<br>
It seems that a file is missing.<br>
With : cp ./lib/common_test/test_server/conf_vars.in /opt/freeware/src/packages/BUILD/otp_src_19.2/release/tests/test_server<br>
that works better.<br>
However, the ERL ts:install(). command fails with:<br>
Running /opt/freeware/src/packages/BUILD/otp_src_19.2/release/tests/test_server/configure
<br>
Env: []<br>
...<br>
configure: error: don't know how to compile and link dynamic drivers<br>
</font></p>
<p><font size="+1"><br>
</font></p>
<p><font size="+1">Salt ? We have very good salt in France ! I'll use !</font></p>
<p><font size="+1"><br>
</font></p>
<p><font size="+1"><b>Thanks </b><b>a lot for your help !!!</b><br>
And expect that it will take some time before I manage all the cases you have detailed for me. First, I need to have Erlang to work with the minimum, with good tests results. Then, I'll add the removed features, one by one.</font></p>
<p><font size="+1"><br>
Regards,</font></p>
<p><font size="+1">Tony<br>
</font></p>
<div class="moz-cite-prefix">Le 15/01/2017 à 19:43, Boroska András a écrit :<br>
</div>
<blockquote cite="mid:CAP=gMb4QCyAgTSWNnmBnNN=MU0mfDO+VV0HuNfD0rE79Nob-9g@mail.gmail.com" type="cite">
<div dir="ltr">Hi Tony,<br>
<br>
On Friday I was too quick to reply and among others I missed the part that you are from Bull. :) I used your R1502 version as the starting point. Still, let me add a few more hints. Mind you my memory can fail (I was working with AIX ~ 2 years ago). Hopefully
the experts will correct me if I got something wrong. View it as my 2 cents. It is not comprehensive as you will realise it soon.<br>
<br>
> “what are the main features that must be made available ?”<br>
<br>
AIX users tend to be large banks and similar organisations, and I imagine many of them interested in running RabbitMQ. So, based on my limited knowledge on the matter if you can start RabbitMQ that might be good enough for many. To list the minimal features
I would say that SMP, 64bit, SSL are very likely. Others readers might add theirs too.<br>
<br>
HIPE:<br>
<br>
Hipe is mainly a performance boost for some applications, but many Erlang use cases do not require it and as Mikael said you can ignore it for now. Linux is always there for people preferring performance over AIX features. :)<br>
<br>
SMP:<br>
<br>
On the other hand I would argue that enabling smp support is probably a must for most use cases and it is not too difficult to achieve. One of the issues is that the AIX provided Assembler does not support the local labels syntax of the GNU Assembler. So, one
either experiments with the GNU Assembler or change the labels and jumps in erts/include/internal/ppc32/atomic.h. See [1] and [2].<br>
<br>
One can replace the label “1:\t” with “L1%=:\t” and replace the corresponding jump “bne- 1b\n\t” with “bne- L1%=\n\t”. Of course use a different label each time (E.g. L1, L2, L3, ...) This might or might not have performance implications, but definitely better
than not having SMP support.<br>
<br>
Since Power8 offers up to 96 simultaneous threads, scheduler binding might be of interest of some potential users. To achieve that replace [3] and [4] with:<br>
<br>
#include “sys/thread.h”<br>
bindprocessor(BINDTHREAD, thread_self(), (cpu_t) cpu)<br>
or something similar.<br>
<br>
64 bit and compiler/linker flags:<br>
<br>
OBJECT_MODE=64 env variable needs to be exported obviously.<br>
<br>
GCC needs the following flags to link the executable: -Wl,-bexpall,-brtl,-b64 -maix64<br>
<br>
For example you might have success bootstrapping by:<br>
<br>
CFLAGS=“-maix64 -g -O2 -D_LINUX_SOURCE_COMPAT -L/opt/freeware/lib64 -L/opt/freeware/lib” \<br>
LDFLAGS=“-Wl,-bexpall,-brtl,-b64,-blibpath:/opt/freeware/lib64:opt/freeware/lib -maix64” \<br>
AR=“ar -X64” \<br>
./otp_build autoconf --with-ssl=/opt/freeware --build=<name of your build> --disable-hipe<br>
<br>
and then the same flags for running ./otp_build configure<br>
<br>
Optionally you can also put the flags into the respective conf files. :)
<div><br>
</div>
<div>Maybe some apps will not compile, like os_mon or odbc. Tip to proceed quickly: you can skip any app by placing an empty file called SKIP in their directory. (lib/*/SKIP)<br>
<br>
OTHER:<br>
<br>
Note that the C standard allows the malloc(0) system call to return either zero or a pointer that cannot be dereferenced. Unixes typically return a non-zero pointer, but AIX returns 0 by default. The C interface of Erlang (erl_interface) calls malloc(0) for
empty strings and checks the return value against 0 to catch allocation errors. To prevent core dumps in such cases it helps to define -D_LINUX_SOURCE_COMPAT which enforces the non-zero pointer returns. Defining it will probably not hurt and users of C drivers
will appreciate.<br>
<br>
As I mentioned R18 reworked clock/time handling. Expect some incompatibilities in that area.<br>
<br>
The missing vsyslog on AIX can potentially be worked around by using printf. Or perhaps you know a better solution.<br>
<br>
As openssl versions seems to go obsolete rather quickly, expect that many users will be interested not only in the binary but also in your source rpm package when you upload to BullFreeware, so they can potentially compile and link with a different openssl
version.<br>
<br>
BASIC TESTING:<br>
<br>
To check if core/thread number detection works start the Erlang shell and note the smp information in the first line. It should match the number of CPU threads you have. For example [smp:8:8]. See [5]<br>
<br>
Also note the presence of [64-bit] on the same line.<br>
<br>
Bonus (may not be critical for many) if you can bind schedulers, for example: erl +sct L0-7c0-7 +stbt db +S8:8<br>
then erlang:system_info(scheduler_bindings). returns {0,1,2,....}<br>
<br>
and erlang:system_info(cpu_topology). returns<br>
[{processor,[{core,{logical,0}},{core,{logical,1}},{core,{logical,2}}, ... }]}]<br>
<br>
While in the shell issue crypto:start(). that should return ok if linking with ssl worked.<br>
<br>
There are also test suites for the emulator. You can run ./otp_build setup with the above CFLAGS, AR, LDFLAGS, add your bin dir to the PATH and run ./otp_build tests. Change dir to release/tests/test_server, run erl, then ts:install(), ts:run(emulator, [batch]).<br>
<br>
Take the above information with a grain of salt as I have no access to AIX and not an expert on building Erlang. The OTP team or others might correct my mistakes.<br>
<br>
Thank you for your work!<br>
<br>
Best regards,<br>
<br>
Andras<br>
<br>
[1] <a moz-do-not-send="true" href="https://gcc.gnu.org/ml/gcc/2005-12/msg00671.html">
https://gcc.gnu.org/ml/gcc/2005-12/msg00671.html</a><br>
[2] <a moz-do-not-send="true" href="http://stackoverflow.com/questions/3898435/labels-in-gcc-inline-assembly">
http://stackoverflow.com/questions/3898435/labels-in-gcc-inline-assembly</a><br>
[3] <a moz-do-not-send="true" href="https://github.com/erlang/otp/blob/maint-19/erts/lib_src/common/erl_misc_utils.c#L591">
https://github.com/erlang/otp/blob/maint-19/erts/lib_src/common/erl_misc_utils.c#L591</a><br>
[4] <a moz-do-not-send="true" href="https://github.com/erlang/otp/blob/maint-19/erts/configure.in#L2294">
https://github.com/erlang/otp/blob/maint-19/erts/configure.in#L2294</a><br>
[5] <a moz-do-not-send="true" href="http://erlang.org/doc/man/erl.html">http://erlang.org/doc/man/erl.html</a><br>
</div>
</div>
</blockquote>
<br>
</body>
</html>