openLDAP compilation, "not a Walk in the Park" PDF Print E-mail
User Rating: / 2
PoorBest 
Written by Michael Felt   

After a question on the forums, and an extra request from a manager I got more interested in examining the compliation process of openLDAP package on AIX.

Generally, compiling openSource packages is a "Walk in the Park", or "no-brainer". openLDAP required a bit of extra effort. I have my guesses as to why, but right now I am running the test. Probably before I finish typing all this, the test will be complete and I can report that as well.


Well, what is an AIX porting "Walk in the Park"? For me, the walk is the next seven steps.

  1. Download package
  2. Unpack package to project directory
  3. Scan README and INSTALL files - especially the .aix versions if included
  4. ./configure
  5. make
  6. make test
  7. su root -c "make install"

With openLDAP my walk was disturbed on step 4. After coming back from a literal walk (coffee, watching my son play football) I was dispointed to see that ./configure was not complete. There was a warning about not finding openssl (which is obviously in /usr/local/openssh) and not finding a proper version of bdb (Berkeley database). This was confusing because /usr/local/BerkeleyDB was a symbolic link to /usr/local/BerkeleyDB.4.4. More confusing, it was finding bdb version 3.3.


When confused go for the detailed notes. openLDAP also makes a file named config.log giving more detail about what it is finding and not finding. To my surprise I saw that gcc was not being used (too many openSource packages only compile with the latest version of gcc). So I: did some research; went back to step 3 and studied the README and INSTALL files; read the AIX related FAQ files on the openLDAP project site.

This resulted in following file (env) and additional substeps:
CPPFLAGS="-I/usr/local/ssl/include -I/usr/local/BerkeleyDB/include"
LDFLAGS="-L/usr/local/ssl/lib -L/usr/local/BerkeleyDB/lib"
LIBPATH=/usr/local/lib:/opt/freeware/lib:/lib:/usr/lib

$ . ./env
$ ./configure


And I got exactly the same results. Thinking it might be the IBM compiler (vac6 is quite an old version) I switched to gcc and got worse results - openLDAP and my gcc installation could not agree on pthread support. So I switched back to vac and started thinking more about the bdb version 3.3 rather than 4.4 as expected (and required! 4.2+ is required). And then I remembered that I also have some RPM from the IBM Toolbox for AIX repository.

# rpm -q -a
cdrecord-1.9-4
mkisofs-1.13-4
scsi.0025-0025-01
readline-4.3-2
db-3.3.11-4
gdbm-1.8.3-2
gettext-0.10.40-1
openssl-0.9.7l-1
gcc-3.3.2-3
gcc-c++-3.3.2-3
zlib-1.2.2-4
python-2.3.4-2
AIX-rpm-5.2.0.85-4

I tried just removing the db package, but python package depends on it, and I use python to keep the rootvg sitemap current. I reexamined the config.log file and also started looking the the generated libtool. What I noticed is that my environment variables were not in either of these files.

And then I realized what I was forgetting? Have you already spotted it? ./configure runs many subshells. Environment variables are not inherited by subshells unless they are exported.

So now I:
add CC=/usr/bin/vac/cc_r to the file env
$ . ./env
$ export CPPFLAGS
$ export LDFLAGS
$ ./configure

And I have a successful configuration. The next step listed in INSTALL is make depend, and the FAQ says for AIX a manual addition is required, so the next step becomes:
$ make depend MKDEP=$PWD/build/mkdep.aix
$ make
$ make test

I am running into some test errors now, so I'll get back on this later.


If you have an error while running "make test" I suggest verifying your free diskspace. Seems mine was running out. After that, the tests that could be run, ran successfully (have to read nohup.out carefully to be sure, but I am an optimist today Wink
 
Login
60 queries executed
1
SET sql_mode = 'MYSQL40'
2 SELECT folder, element, published, params FROM jos_mambots WHERE published >= 1 AND access <= 0 AND folder = 'system' ORDER BY ordering
3 SELECT template FROM jos_templates_menu WHERE client_id = 0 AND ( menuid = 0 OR menuid = 309 ) ORDER BY menuid DESC LIMIT 1
4 DELETE FROM jos_session WHERE ( ( time < '1548314246' ) AND guest = 0 AND gid > 0 ) OR ( ( time < '1548314246' ) AND guest = 1 AND userid = 0 )
5 SELECT COUNT(*) FROM jos_stats_agents WHERE agent = 'Unknown' AND type = 0
6 UPDATE jos_stats_agents SET hits = ( hits + 1 ) WHERE agent = 'Unknown' AND type = 0
7 SELECT COUNT(*) FROM jos_stats_agents WHERE agent = 'Unknown' AND type = 1
8 UPDATE jos_stats_agents SET hits = ( hits + 1 ) WHERE agent = 'Unknown' AND type = 1
9 SELECT COUNT(*) FROM jos_stats_agents WHERE agent = 'com' AND type = 2
10 UPDATE jos_stats_agents SET hits = ( hits + 1 ) WHERE agent = 'com' AND type = 2
11 SELECT * FROM jos_menu WHERE id = 309
12 SELECT a.*, u.name AS author, u.usertype, cc.name AS category, s.name AS section, g.name AS groups, s.published AS sec_pub, cc.published AS cat_pub, s.access AS sec_access, cc.access AS cat_access, s.id AS sec_id, cc.id as cat_id FROM jos_content AS a LEFT JOIN jos_categories AS cc ON cc.id = a.catid LEFT JOIN jos_sections AS s ON s.id = cc.section AND s.scope = 'content' LEFT JOIN jos_users AS u ON u.id = a.created_by LEFT JOIN jos_groups AS g ON a.access = g.id WHERE a.id = 97 AND ( a.state = 1 OR a.state = -1 ) AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2019-01-24 08:32' ) AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2019-01-24 08:32' ) AND a.access <= 0
13 SELECT a.id FROM jos_content AS a WHERE a.catid = 30 AND a.state = 1 AND a.access <= 0 AND ( a.state = 1 OR a.state = -1 ) AND ( a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2019-01-24 08:32' ) AND ( a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2019-01-24 08:32' ) ORDER BY a.created DESC
14 SELECT ROUND( v.rating_sum / v.rating_count ) AS rating, v.rating_count FROM jos_content AS a LEFT JOIN jos_content_rating AS v ON a.id = v.content_id WHERE a.id = 97
15 UPDATE jos_content SET hits = ( hits + 1 ) WHERE id = '97'
16 SELECT hits FROM jos_core_log_items WHERE time_stamp = '2019-01-24' AND item_table = '#__content' AND item_id = '97'
17 UPDATE jos_core_log_items SET hits = ( hits + 1 ) WHERE time_stamp = '2019-01-24' AND item_table = '#__content' AND item_id = '97'
18 SELECT folder, element, published, params FROM jos_mambots WHERE access <= 0 AND folder = 'content' ORDER BY ordering
19 SELECT value FROM jos_bookmarks_prefs WHERE userid = '-1' AND category = 'params' AND name = 'urlkey'
20 SELECT value FROM jos_bookmarks_prefs WHERE userid = '-1' AND category = 'params' AND name = 'snapshotactiv'
21 SELECT value FROM jos_bookmarks_prefs WHERE userid = '-1' AND category = 'params' AND name = 'snapshotother'
22 SELECT id FROM jos_mambots WHERE element = 'mosbookmarks' AND folder = 'content'
23 SELECT * FROM jos_mambots WHERE id = '32'
24 SELECT name, value FROM jos_bookmarks_prefs WHERE userid = '-1' AND category = 'params' ORDER BY name
25 SELECT c.id, c.parent FROM jos_bookmarks_categories as c WHERE c.id = -1
26 SELECT * FROM jos_bookmarks_columns WHERE category='' AND custom='0'
27 SELECT * FROM jos_bookmarks_columns WHERE category='' ORDER BY ordering
28 SELECT * FROM jos_bookmarks_columns WHERE category='admin'
29 SELECT * FROM jos_bookmarks_columns WHERE category='admin' ORDER BY ordering
30 SELECT id FROM jos_mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'
31 SELECT * FROM jos_mambots WHERE id = '27'
32 SELECT id FROM jos_mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'
33 SELECT * FROM jos_mambots WHERE id = '27'
34 SELECT id FROM jos_mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'
35 SELECT * FROM jos_mambots WHERE id = '27'
36 SELECT id FROM jos_mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'
37 SELECT * FROM jos_mambots WHERE id = '27'
38 SELECT a.* FROM jos_components AS a WHERE ( a.admin_menu_link = 'option=com_syndicate' OR a.admin_menu_link = 'option=com_syndicate&hidemainmenu=1' ) AND a.option = 'com_syndicate'
39 SELECT m.id FROM jos_modules AS m WHERE m.module = 'mod_rssfeed' AND m.published = 1
40 SELECT id, title, module, position, content, showtitle, params FROM jos_modules AS m INNER JOIN jos_modules_menu AS mm ON mm.moduleid = m.id WHERE m.published = 1 AND m.access <= 0 AND m.client_id != 1 AND ( mm.menuid = 0 OR mm.menuid = 309 ) ORDER BY ordering
41 SELECT id FROM jos_menu WHERE link = 'index.php?option=com_search' AND published = 1
42 SELECT m.*, sum(case when p.published=1 then 1 else 0 end) as cnt FROM jos_menu AS m LEFT JOIN jos_menu AS p ON p.parent = m.id WHERE m.menutype='rt_splitSuckerFish' AND m.published='1' AND m.access <= '0' GROUP BY m.id ORDER BY m.parent, m.ordering
43 SELECT m.* FROM jos_menu AS m WHERE menutype='rt_splitSuckerFish' AND m.published='1'
44 SELECT * FROM jos_banner WHERE showBanner=1
45 SELECT id FROM jos_mambots WHERE element = 'mosbookmarks' AND folder = 'content'
46 SELECT * FROM jos_mambots WHERE id = '32'
47 SELECT name, value FROM jos_bookmarks_prefs WHERE userid = '-1' AND category = 'params' ORDER BY name
48 SELECT c.id, c.parent FROM jos_bookmarks_categories as c WHERE c.id = -1
49 SELECT * FROM jos_bookmarks_columns WHERE category='' AND custom='0'
50 SELECT * FROM jos_bookmarks_columns WHERE category='' ORDER BY ordering
51 SELECT * FROM jos_bookmarks_columns WHERE category='admin'
52 SELECT * FROM jos_bookmarks_columns WHERE category='admin' ORDER BY ordering
53 SELECT id FROM jos_mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'
54 SELECT * FROM jos_mambots WHERE id = '27'
55 SELECT id FROM jos_mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'
56 SELECT * FROM jos_mambots WHERE id = '27'
57 SELECT id FROM jos_mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'
58 SELECT * FROM jos_mambots WHERE id = '27'
59 SELECT id FROM jos_mambots WHERE element = 'plugin_jw_allvideos' AND folder = 'content'
60 SELECT * FROM jos_mambots WHERE id = '27'