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

Issue to compile due to "wchar_t type" missing #570

Closed
jplu opened this issue Jul 28, 2016 · 2 comments
Closed

Issue to compile due to "wchar_t type" missing #570

jplu opened this issue Jul 28, 2016 · 2 comments

Comments

@jplu
Copy link

jplu commented Jul 28, 2016

Hello,

I'm trying to compile Virtuoso with a Alpine Linux version in order to have lightweight version of Virtuoso in a Docker container. Here the steps to reproduce:

docker run -it alpine:3.4 /bin/sh
apk --no-cache add git wget openssl openssl-dev ca-certificates libgcc autoconf automake bison flex gawk gperf libtool gcc g++ make readline-dev libxml2-dev --update
update-ca-certificates --fresh
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://raw.githubusercontent.com/sgerrand/alpine-pkg-glibc/master/sgerrand.rsa.pub
wget -q -O /var/cache/apk/glibc-2.23-r3.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.23-r3/glibc-2.23-r3.apk
wget -q -O /var/cache/apk/glibc-bin-2.23-r3.apk https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.23-r3/glibc-bin-2.23-r3.apk
apk add --no-cache /var/cache/apk/glibc-2.23-r3.apk /var/cache/apk/glibc-bin-2.23-r3.apk
/usr/glibc-compat/sbin/ldconfig /lib /usr/glibc/usr/lib
git clone https://github.com/openlink/virtuoso-opensource.git
cd virtuoso-opensource
git checkout 0468195ac3923c0a9f010fa2da7e93da9febe228
./autogen.sh
export CFLAGS="-O2 -m64"
./configure --program-transform-name="s/isql/isql-v/" --enable-conductor-vad --enable-maintainer-mode --with-readline --enable-fct-vad
make

And during the make I get the following error:

/bin/bash ../../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I. -I../../libsrc/Dk    -fno-strict-aliasing -O2  -Wall  -DNDEBUG -DPOINTER_64   -I/virtuoso-opensource/libsrc/Xml.new  -DOPENSSL_NO_KRB5 -Dlinux -D_GNU_SOURCE -DFILE64 -D_LARGEFILE64_SOURCE   -I../../libsrc -I../../libsrc/Dk -I../../libsrc/zlib -I. -I../../libsrc/langfunc -I../../libsrc/plugin -I../../libsrc/Tidy -I../../libsrc/Xml.new -I../../libsrc/odbcsdk/include -DVAD -DDBP -DBIF_XPER -DOPSYS=\"Linux\" -DHOST=\"x86_64-unknown-linux-gnu\" -O2 -m64 -MT libwi_la-aqueue.lo -MD -MP -MF .deps/libwi_la-aqueue.Tpo -c -o libwi_la-aqueue.lo `test -f 'aqueue.c' || echo './'`aqueue.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I../../libsrc/Dk -fno-strict-aliasing -O2 -Wall -DNDEBUG -DPOINTER_64 -I/virtuoso-opensource/libsrc/Xml.new -DOPENSSL_NO_KRB5 -Dlinux -D_GNU_SOURCE -DFILE64 -D_LARGEFILE64_SOURCE -I../../libsrc -I../../libsrc/Dk -I../../libsrc/zlib -I. -I../../libsrc/langfunc -I../../libsrc/plugin -I../../libsrc/Tidy -I../../libsrc/Xml.new -I../../libsrc/odbcsdk/include -DVAD -DDBP -DBIF_XPER -DOPSYS=\"Linux\" -DHOST=\"x86_64-unknown-linux-gnu\" -O2 -m64 -MT libwi_la-aqueue.lo -MD -MP -MF .deps/libwi_la-aqueue.Tpo -c aqueue.c  -fPIC -DPIC -o .libs/libwi_la-aqueue.o
In file included from ../../libsrc/odbcsdk/include/sql.h:91:0,
                 from odbcinc.h:72,
                 from sqlnode.h:31,
                 from aqueue.c:28:
../../libsrc/odbcsdk/include/sqltypes.h:399:6: error: #error Please make sure your system supports the wchar_t type
 #    error Please make sure your system supports the wchar_t type
      ^
In file included from ../../libsrc/odbcsdk/include/sqlext.h:2565:0,
                 from odbcinc.h:73,
                 from sqlnode.h:31,
                 from aqueue.c:28:
../../libsrc/odbcsdk/include/sqlucode.h:135:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szDSN,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:137:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szUID,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:139:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szAuthStr,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:145:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szColName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:157:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSqlState,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:159:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szErrorMsg,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:165:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSqlStr,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:177:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCursor,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:200:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:223:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSqlState,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:225:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szErrorMsg,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:232:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSqlStr,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:243:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCursor,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:248:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:250:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:252:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:254:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szColumnName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:281:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:283:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:285:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:292:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:294:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:296:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:303:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:305:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:307:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:309:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szTableType,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:315:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szDSN,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:318:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szDescription,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:325:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szConnStrIn,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:327:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szConnStrOut,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:334:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szConnStrIn,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:336:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szConnStrOut,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:342:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:344:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:346:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:348:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szColumnName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:366:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szPkCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:368:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szPkSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:370:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szPkTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:372:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szFkCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:374:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szFkSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:376:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szFkTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:381:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSqlStrIn,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:383:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSqlStr,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:389:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:391:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:393:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:398:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:400:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:402:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szProcName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:404:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szColumnName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:409:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:411:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:413:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szProcName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:418:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szCatalogName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:420:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szSchemaName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:422:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szTableName,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:428:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szDriverDesc,
     ^
../../libsrc/odbcsdk/include/sqlucode.h:431:5: error: unknown type name 'SQLWCHAR'
     SQLWCHAR  * szDriverAttributes,
     ^
In file included from ../../libsrc/Dk.h:97:0,
                 from wi.h:56,
                 from sqlnode.h:32,
                 from aqueue.c:28:
../../libsrc/Dk/tlsf.h:162:0: warning: "PAGE_SIZE" redefined
 #define PAGE_SIZE (getpagesize())
 ^
In file included from /usr/include/limits.h:8:0,
                 from ../../libsrc/Dk/Dksystem.h:101,
                 from ../../libsrc/Dk.h:40,
                 from wi.h:56,
                 from sqlnode.h:32,
                 from aqueue.c:28:
/usr/include/bits/limits.h:3:0: note: this is the location of the previous definition
 #define PAGE_SIZE 4096
 ^
Makefile:1273: recipe for target 'libwi_la-aqueue.lo' failed
make[3]: *** [libwi_la-aqueue.lo] Error 1
make[3]: Leaving directory '/virtuoso-opensource/libsrc/Wi'
Makefile:964: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/virtuoso-opensource/libsrc/Wi'
Makefile:475: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/virtuoso-opensource/libsrc'
Makefile:631: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Any idea of what is missing as lib or package? Or going wrong with my steps?

Thanks in advance.

@openlink
Copy link
Owner

openlink commented Jul 28, 2016

The problem is that virtuoso tries to figure out the wchar_t type in the C library, and Alpine is using a different method to let the compiler know what type to use.

I have made a provisional patch you can try which resolves this issue:
vos-alpine-build.diff.txt

I will do some more checking, but it looks like this is the only patch needed to get Virtuoso to build on Alpine Linux.

Final patches will be committed to the develop/7 branch to be included in the next stable release.

Note that your construction to clone the git tree is sub-optimal, especially when using a SHA signature to get to a specific branch or tag. While this works, the following commands will do the same thing and are fully supported by the version of git on Alpine:

 # Clone the latest VOS 7.x release from stable/7
git clone -b stable/7 --single-branch --depth=1 https://github.com/openlink/virtuoso-opensource

# Clone a specific tag 
git clone -b v7.2.4.2 --single-branch --depth=1 https://github.com/openlink/virtuoso-opensource

The --single-branch --depth=1 limits the size of the .git repo that is actually downloaded/installed to just that particular branch and without any history since you are not using it for development, just to make a port of the code.

@jplu
Copy link
Author

jplu commented Jul 28, 2016

Works like a charm now!

Thanks a lot for the fix and the hint.

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