Hello,

I'm attempting to build Xalan-C++ 1.12 following the build steps found at:
  https://apache.github.io/xalan-c/build.html

Build environment:
CentOS 7 (up-to-date), cmake3 version 3.17.3, gcc 8.2.0
Xerces-C++ 3.2.3 build from the sources, using autotools and these configure 
options:
  ./configure --disable-rpath --disable-network --without-icu 
--prefix=/mypath/xerces/3.2.3 

gcc 8.2.0:
$ export LD_LIBRARY_PATH=/mypath/gcc/8.2.0/lib64:$LD_LIBRARY_PATH
$ export PATH=/mypath/gcc/8.2.0/bin:$PATH

$ export PKG_CONFIG_PATH=/mypath/xerces/3.2.3/lib/pkgconfig:$PKG_CONFIG_PATH

I'm describing the issues and questions I've had during my attempt to
configure and build Xalan-C++ 1.12..


1. cmake won't detect the C compiler properly (but do we care?):

$ mkdir build && cd build
$ cmake3 -DCMAKE_INSTALL_PREFIX=$TOOLS/xalan-c-1.12 -Dtranscoder=default ..

[snip]
-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 8.2.0
[snip]

The system C compiler *is* gcc 4.8.5, but the one first found on the PATH is 
gcc 8.2.0.
What wrong magics is performed there? Do we care anyway?


2. cmake won't detect Xerces-C++ 3.2.3:

[snip]
CMake Error at 
/usr/share/cmake3/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Failed to find XercesC (missing: XercesC_LIBRARY XercesC_INCLUDE_DIR
  XercesC_VERSION) (Required is at least version "3.1")
[snip]

Obviously it doesn't use PKG_CONFIG_PATH to find it, which is wrong if 
xerces-C++ has been built using autotools (this is the recommended method on 
GNU/Linux).

I solved it using:
$ cmake3 -DCMAKE_INSTALL_PREFIX=$TOOLS/xalan-c-1.12 -Dtranscoder=default 
-DXercesC_VERSION=3.2.3 -DXercesC_LIBRARY="-L/mypath/xerces/3.2.3/lib" 
-DXercesC_INCLUDE_DIR=$TOOLS/xerces/3.2.3/include ..

But I'm not sure this will work, probably missing a -lxerces-c in 
XercesC_LIBRARY.


3. ICU seems required or checked whereas I explicitly want the built-in
transcoder (default).

I come up to here:

-- The C compiler identification is GNU 4.8.5
-- The CXX compiler identification is GNU 8.2.0
-- Check for working C compiler: /usr/lib64/ccache/cc
-- Check for working C compiler: /usr/lib64/ccache/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib64/ccache/c++
-- Check for working CXX compiler: /usr/lib64/ccache/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring Apache Xalan-C++ version 1.12.0
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Doxygen: /bin/doxygen (found version "1.8.5") found components: 
doxygen dot
-- Performing Test CXX_FLAG_Wall
-- Performing Test CXX_FLAG_Wall - Success
-- Performing Test CXX_FLAG_Wcast_align
-- Performing Test CXX_FLAG_Wcast_align - Success
-- Performing Test CXX_FLAG_Wcast_qual
-- Performing Test CXX_FLAG_Wcast_qual - Success
-- Performing Test CXX_FLAG_Wctor_dtor_privacy
-- Performing Test CXX_FLAG_Wctor_dtor_privacy - Success
-- Performing Test CXX_FLAG_Wextra
-- Performing Test CXX_FLAG_Wextra - Success
-- Performing Test CXX_FLAG_Wformat_2
-- Performing Test CXX_FLAG_Wformat_2 - Success
-- Performing Test CXX_FLAG_Wimplicit_atomic_properties
-- Performing Test CXX_FLAG_Wimplicit_atomic_properties - Failed
-- Performing Test CXX_FLAG_Wmissing_declarations
-- Performing Test CXX_FLAG_Wmissing_declarations - Success
-- Performing Test CXX_FLAG_Wno_long_long
-- Performing Test CXX_FLAG_Wno_long_long - Success
-- Performing Test CXX_FLAG_Woverlength_strings
-- Performing Test CXX_FLAG_Woverlength_strings - Success
-- Performing Test CXX_FLAG_Woverloaded_virtual
-- Performing Test CXX_FLAG_Woverloaded_virtual - Success
-- Performing Test CXX_FLAG_Wredundant_decls
-- Performing Test CXX_FLAG_Wredundant_decls - Success
-- Performing Test CXX_FLAG_Wreorder
-- Performing Test CXX_FLAG_Wreorder - Success
-- Performing Test CXX_FLAG_Wswitch_default
-- Performing Test CXX_FLAG_Wswitch_default - Success
-- Performing Test CXX_FLAG_Wunused_variable
-- Performing Test CXX_FLAG_Wunused_variable - Success
-- Performing Test CXX_FLAG_Wwrite_strings
-- Performing Test CXX_FLAG_Wwrite_strings - Success
-- Performing Test CXX_FLAG_Wno_variadic_macros
-- Performing Test CXX_FLAG_Wno_variadic_macros - Success
-- Performing Test CXX_FLAG_fstrict_aliasing
-- Performing Test CXX_FLAG_fstrict_aliasing - Success
-- Looking for signal
-- Looking for signal - found
-- Looking for SetConsoleCtrlHandler
-- Looking for SetConsoleCtrlHandler - not found
-- Looking for usleep
-- Looking for usleep - found
-- Looking for Sleep
-- Looking for Sleep - not found
-- Looking for gmtime_r
-- Looking for gmtime_r - found
-- Looking for localtime_r
-- Looking for localtime_r - found
-- Looking for _create_locale
-- Looking for _create_locale - not found
-- Looking for isnan
-- Looking for isnan - found
-- Looking for _isnan
-- Looking for _isnan - not found
-- Performing Test XALAN_HAVE_STD_ISNAN
-- Performing Test XALAN_HAVE_STD_ISNAN - Success
-- Looking for unistd.h
-- Looking for unistd.h - found
-- Looking for direct.h
-- Looking for direct.h - not found
-- Found the following ICU libraries:
--   uc (required)
--   data (required)
--   i18n (required)
-- Found ICU: /usr/include (found version "50.2")
-- Found XercesC: -L/mypath/xerces/3.2.3/lib (found suitable version "3.2.3", 
minimum required is "3.1")
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - yes
-- Performing Test XALAN_HAVE_STD_THREAD
-- Performing Test XALAN_HAVE_STD_THREAD - Success
-- Looking for C++ include nl_types.h
-- Looking for C++ include nl_types.h - found
-- Looking for catopen
-- Looking for catopen - found
-- Looking for catclose
-- Looking for catclose - found
-- Looking for catgets
-- Looking for catgets - found
-- Performing Test CXX_matching-delete-operator
-- Performing Test CXX_matching-delete-operator - Success
-- Performing Test HAVE_PATH_MAX
-- Performing Test HAVE_PATH_MAX - Success
--
-- Xalan-C++ configuration summary
-- -------------------------------
--
--   Version:                     1.12.0
--   Library major version:       112
--   Library minor version:       0
--
--   Installation directory:      /mypath/xalan-c-1.12
--   C compiler:                  /usr/lib64/ccache/cc
--   C++ compiler:                /usr/lib64/ccache/c++
--
--   Build shared libraries:      ON
--   Thread implementation:       standard
--   Transcoder:                  default
--   Message Loader:              inmemory
--   Message Loader Locale:       en_US
-- Configuring done
-- Generating done
-- Build files have been written to: /mypath/build/xalan-c-1.12/build

Does this mean that the ICU libraries are mandatory? The build doc page
says "ICU C++ libraries and headers (optional)". Why does cmake check
for ICU libraries if they are optional and the transcoder explicitely
set NOT to use ICU?

Note that if I remove the system ICU dev files, I'll get:

-- The following ICU libraries were not found:
--   uc (required)
--   data (required)
--   i18n (required)
-- Failed to find all ICU components (missing: ICU_INCLUDE_DIR ICU_LIBRARY 
_ICU_REQUIRED_LIBS_FOUND)

Anyway, the cmake configure step does not fail.


4. is there a way NOT to build the docs?

I could not find such a way. I don't need them, doc build requirements
are not clear or even specified anywhere I could find, and it fails here
anyway (rule xalan-c-doc-check).

[skipping a huge UNDOCUMENTED CODE section]
[  0%] Built target xalan-c-doc-check
make: *** [all] Error 2


Regards,

-- 
wwp
https://useplaintext.email/

Attachment: pgpDC50v9bHIW.pgp
Description: OpenPGP digital signature

Reply via email to