QtGiac & Windows

Librairie C++ de calcul formel/ C++ symbolic computation library

Modérateur : xcasadmin

Répondre
loic
Messages : 168
Inscription : ven. mars 14, 2008 7:20 pm

QtGiac & Windows

Message par loic » mar. juin 12, 2012 9:00 pm

Bonsoir,

Je viens de faire une tentative de compilation sous Windows

Installation du SDK de Qt: visiblement, il contient minGW ...
Je lance Qtcreator, les PATH me semblent corrects globalement pour le peu que je m'y connaissent
Lorsqu'on lance la compil, message d'erreur dès le début

Code : Tout sélectionner

error: sys/time.h no such file or directory
error: sys/resource.h no such file or directory
une petite idée de ce qu'il faut rajouter?

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QtGiac & Windows

Message par parisse » mer. juin 13, 2012 8:50 am

il faut refaire un config.h, en excluant toutes les specificites unix. Genre commenter
#define HAVE_SYS_TIMES_H 1

loic
Messages : 168
Inscription : ven. mars 14, 2008 7:20 pm

Re: QtGiac & Windows

Message par loic » mer. juin 13, 2012 9:06 am

Là, j'ai bien peur que cela dépasse ma compétence...

En fait, ça serait un deuxième fichier genre config_win32.h à n'utiliser que pour windows?
Je sais qu'il est possible de mettre des instructions spécifiques à un OS dans le fichier test.pro du projet Qt.

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QtGiac & Windows

Message par parisse » mer. juin 13, 2012 9:27 am

je vais essayer de regarder ca, mais ca devra attendre demain, j'ai des oraux blancs d'agreg aujourd'hui...

loic
Messages : 168
Inscription : ven. mars 14, 2008 7:20 pm

Re: QtGiac & Windows

Message par loic » mer. juin 13, 2012 9:35 am

Y a pas de problèmes, c'est pas du tout urgent.

Prends ton temps et ... ménage tes futurs candidats! ;)

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QtGiac & Windows

Message par parisse » mer. juin 13, 2012 10:31 am

bon, je viens de retrouver un config.h pour mingw qui fait peut-etre l'affaire apres tout, je le joins. Si ca ne marche pas, je ferai des modifs demain avec qtgiac.

Code : Tout sélectionner

/* config.h.  Generated from config.h.in by configure.  */
/* config.h.in.  Generated from configure.in by autoheader.  */

/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
   systems. This function is required for `alloca.c' support on those systems.
   */
/* #undef CRAY_STACKSEG_END */

/* Define to 1 if using `alloca.c'. */
/* #undef C_ALLOCA */

/* Set if debugging is enabled */
#define DEBUG_SUPPORT 

/* Define to 1 if translation of program messages to the user's native
   language is requested. */
#define ENABLE_NLS 1

/* Define if <ext/hash_map> header is aviailable */
#define EXT_HASH_MAP 1

/* Define if <hash_map> header is aviailable */
#define HASH_MAP 1

/* Define to 1 if you have `alloca', as a function or macro. */
#define HAVE_ALLOCA 1

/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
   */
/* #undef HAVE_ALLOCA_H */

/* Define to 1 if you have the <argz.h> header file. */
/* #undef HAVE_ARGZ_H */

/* Define to 1 if you have the `asprintf' function. */
/* #undef HAVE_ASPRINTF */

/* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the
   CoreFoundation framework. */
/* #undef HAVE_CFLOCALECOPYCURRENT */

/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
   the CoreFoundation framework. */
/* #undef HAVE_CFPREFERENCESCOPYAPPVALUE */

/* Define if the GNU dcgettext() function is already present or preinstalled.
   */
/* #undef HAVE_DCGETTEXT */

/* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
   don't. */
#define HAVE_DECL_FEOF_UNLOCKED 0

/* Define to 1 if you have the declaration of `fgets_unlocked', and to 0 if
   you don't. */
#define HAVE_DECL_FGETS_UNLOCKED 0

/* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
   don't. */
#define HAVE_DECL_GETC_UNLOCKED 0

/* Define to 1 if you have the declaration of `_snprintf', and to 0 if you
   don't. */
#define HAVE_DECL__SNPRINTF 0

/* Define to 1 if you have the declaration of `_snwprintf', and to 0 if you
   don't. */
#define HAVE_DECL__SNWPRINTF 0

/* Define to 1 if you have the <dlfcn.h> header file. */
/* #undef HAVE_DLFCN_H */

/* Define to 1 if you have the `fwprintf' function. */
/* #undef HAVE_FWPRINTF */

/* Define to 1 if you have the `getcwd' function. */
#define HAVE_GETCWD 1

/* Define to 1 if you have the `getegid' function. */
/* #undef HAVE_GETEGID */

/* Define to 1 if you have the `geteuid' function. */
/* #undef HAVE_GETEUID */

/* Define to 1 if you have the `getgid' function. */
/* #undef HAVE_GETGID */

/* Define to 1 if you have the `getpagesize' function. */
#define HAVE_GETPAGESIZE 1

/* Define to 1 if you have the `getpid' function. */
#define HAVE_GETPID 1

/* Define to 1 if you have the `getpwuid' function. */
/* #undef HAVE_GETPWUID */

/* Define if the GNU gettext() function is already present or preinstalled. */
/* #undef HAVE_GETTEXT */

/* Define to 1 if you have the `getuid' function. */
/* #undef HAVE_GETUID */

/* Define to 1 if you have the <gmpxx.h> header file. */
/* #undef HAVE_GMPXX_H */

/* Define to 1 if you have the <gsl/gsl_blas.h> header file. */
/* #undef HAVE_GSL_GSL_BLAS_H */

/* Define to 1 if you have the <gsl/gsl_eigen.h> header file. */
/* #undef HAVE_GSL_GSL_EIGEN_H */

/* Define if you have the iconv() function. */
/* #undef HAVE_ICONV */

/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
#define HAVE_INTMAX_T 1

/* Define if <inttypes.h> exists and doesn't clash with <sys/types.h>. */
#define HAVE_INTTYPES_H 1

/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
   declares uintmax_t. */
#define HAVE_INTTYPES_H_WITH_UINTMAX 1

/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
/* #undef HAVE_LANGINFO_CODESET */

/* Define if your <locale.h> file defines LC_MESSAGES. */
/* #undef HAVE_LC_MESSAGES */

/* Define to 1 if you have the `cocoa' library (-lcocoa). */
/* #undef HAVE_LIBCOCOA */

/* Define to 1 if you have the `dl' library (-ldl). */
/* #undef HAVE_LIBDL */

/* Define to 1 if you have the `fltk' library (-lfltk). */
/* #undef HAVE_LIBFLTK */

/* Define to 1 if you have the `fltk_gl' library (-lfltk_gl). */
/* #undef HAVE_LIBFLTK_GL */

/* Define to 1 if you have the `fltk_images' library (-lfltk_images). */
/* #undef HAVE_LIBFLTK_IMAGES */

/* Now defined if fltk is available */
/* #undef HAVE_LIBFLVW */

/* Define to 1 if you have the `fontconfig' library (-lfontconfig). */
/* #undef HAVE_LIBFONTCONFIG */

/* Define to 1 if you have the `gc' library (-lgc). */
/* #undef HAVE_LIBGC */

/* Define to 1 if you have the `GL' library (-lGL). */
/* #undef HAVE_LIBGL */

/* Define to 1 if you have the `gmpxx' library (-lgmpxx). */
/* #undef HAVE_LIBGMPXX */

/* Define to 1 if you have the `gsl' library (-lgsl). */
/* #undef HAVE_LIBGSL */

/* Define to 1 if you have the `gslcblas' library (-lgslcblas). */
/* #undef HAVE_LIBGSLCBLAS */

/* Define to 1 if you have the `intl' library (-lintl). */
/* #undef HAVE_LIBINTL */

/* Define to 1 if you have the `intl.dll' library (-lintl.dll). */
/* #undef HAVE_LIBINTL_DLL */

/* Define to 1 if you have the `jpeg' library (-ljpeg). */
/* #undef HAVE_LIBJPEG */

/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1

/* Define to 1 if you have the `mpfr' library (-lmpfr). */
/* #undef HAVE_LIBMPFR */

/* Define to 1 if you have the `ntl' library (-lntl). */
/* #undef HAVE_LIBNTL */

/* Define to 1 if you have the `pari' library (-lpari). */
/* #undef HAVE_LIBPARI */

/* Define to 1 if you have the `png' library (-lpng). */
/* #undef HAVE_LIBPNG */

/* Define to 1 if you have the `pthread' library (-lpthread). */
/* #define HAVE_LIBPTHREAD 1 */

/* Define to 1 if you have the `readline' library (-lreadline). */
/* #undef HAVE_LIBREADLINE */

/* Define to 1 if you have the `rt' library (-lrt). */
/* #undef HAVE_LIBRT */

/* Define to 1 if you have the `tommath' library (-ltommath). */
/* #undef HAVE_LIBTOMMATH */

/* Define to 1 if you have the `Xext' library (-lXext). */
/* #undef HAVE_LIBXEXT */

/* Define to 1 if you have the `Xft' library (-lXft). */
/* #undef HAVE_LIBXFT */

/* Define to 1 if you have the `Xinerama' library (-lXinerama). */
/* #undef HAVE_LIBXINERAMA */

/* Define to 1 if you have the `z' library (-lz). */
#define HAVE_LIBZ 1

/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1

/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1

/* Define if you have the 'long double' type. */
#define HAVE_LONG_DOUBLE 1

/* Define if you have the 'long long' type. */
#define HAVE_LONG_LONG 1

/* Define to 1 if you have the <malloc.h> header file. */
#define HAVE_MALLOC_H 1

/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1

/* Define to 1 if you have the `mempcpy' function. */
/* #undef HAVE_MEMPCPY */

/* Define to 1 if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */

/* Define to 1 if you have the <mpfr.h> header file. */
/* #undef HAVE_MPFR_H */

/* Define to 1 if you have the `mpfr_set_str_raw' function. */
/* #undef HAVE_MPFR_SET_STR_RAW */

/* Define to 1 if you have the `munmap' function. */
/* #undef HAVE_MUNMAP */

/* Define to 1 if you have the <nl_types.h> header file. */
/* #undef HAVE_NL_TYPES_H */

/* Set if getcwd() function is NOT available */
/* #undef HAVE_NO_CWD */

/* Set if getpwuid() function is NOT available */
#define HAVE_NO_HOME_DIRECTORY 1

/* Set if pwd.h is NOT available */
#define HAVE_NO_PWD_H 1

/* Set if getpid() function is NOT available */
/* #undef HAVE_NO_SIGNAL_H */

/* Set if system() function is NOT available */
/* #undef HAVE_NO_SYSTEM */

/* Set if <sys/resource.h> is NOT available */
#define HAVE_NO_SYS_RESOURCE_WAIT_H 1

/* Set if <sys/times.h> is NOT available */
#define HAVE_NO_SYS_TIMES_H 1

/* Define to 1 if you have the <pari/pari.h> header file. */
/* #undef HAVE_PARI_PARI_H */

/* Define to 1 if you have the <png.h> header file. */
/* #undef HAVE_PNG_H */

/* Define if your printf() function supports format strings with positions. */
/* #undef HAVE_POSIX_PRINTF */

/* Define to 1 if you have the <pthread.h> header file. */
/* #define HAVE_PTHREAD_H 1 */

/* Define to 1 if you have the `putenv' function. */
/* #undef HAVE_PUTENV */

/* Define to 1 if you have the <pwd.h> header file. */
/* #undef HAVE_PWD_H */

/* Define to 1 if you have the <readline/history.h> header file. */
/* #undef HAVE_READLINE_HISTORY_H */

/* Define to 1 if you have the <readline/readline.h> header file. */
/* #undef HAVE_READLINE_READLINE_H */

/* Define to 1 if you have the `setenv' function. */
/* #undef HAVE_SETENV */

/* Define to 1 if you have the `setlocale' function. */
/* #undef HAVE_SETLOCALE */

/* Define to 1 if you have the <signal.h> header file. */
#define HAVE_SIGNAL_H 1

/* Define to 1 if you have the `snprintf' function. */
/* #undef HAVE_SNPRINTF */

/* Set to enable semi-classical routines */
/* #undef HAVE_SSCL */

/* Define to 1 if you have the <sstream> header file. */
#define HAVE_SSTREAM 1

/* Define to 1 if you have the <stddef.h> header file. */
#define HAVE_STDDEF_H 1

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
   uintmax_t. */
#define HAVE_STDINT_H_WITH_UINTMAX 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the `stpcpy' function. */
/* #undef HAVE_STPCPY */

/* Define to 1 if you have the `strcasecmp' function. */
/* #undef HAVE_STRCASECMP */

/* Define to 1 if you have the `strdup' function. */
/* #undef HAVE_STRDUP */

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the `strtoul' function. */
/* #undef HAVE_STRTOUL */

/* Define to 1 if you have the `sysconf' function. */
/* #undef HAVE_SYSCONF */

/* Define to 1 if you have the `system' function. */
#define HAVE_SYSTEM 1

/* Define to 1 if you have the <sys/param.h> header file. */
#define HAVE_SYS_PARAM_H 1

/* Define to 1 if you have the <sys/resource.h> header file. */
/* #undef HAVE_SYS_RESOURCE_H */

/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1

/* Define to 1 if you have the <sys/times.h> header file. */
/* #undef HAVE_SYS_TIMES_H */

/* Define to 1 if you have the <sys/time.h> header file. */
#define HAVE_SYS_TIME_H 1

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the `tgetent' function. */
/* #undef HAVE_TGETENT */

/* Define to 1 if you have the <tommath.h> header file. */
/* #undef HAVE_TOMMATH_H */

/* Define to 1 if you have the `tsearch' function. */
/* #undef HAVE_TSEARCH */

/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */
#define HAVE_UINTMAX_T 1

/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1

/* Define if you have the 'unsigned long long' type. */
#define HAVE_UNSIGNED_LONG_LONG 1

/* Define if you have the 'wchar_t' type. */
#define HAVE_WCHAR_T 1

/* Define to 1 if you have the `wcslen' function. */
/* #undef HAVE_WCSLEN */

/* Define if you have the 'wint_t' type. */
#define HAVE_WINT_T 1

/* Define to 1 if you have the `__argz_count' function. */
/* #undef HAVE___ARGZ_COUNT */

/* Define to 1 if you have the `__argz_next' function. */
/* #undef HAVE___ARGZ_NEXT */

/* Define to 1 if you have the `__argz_stringify' function. */
/* #undef HAVE___ARGZ_STRINGIFY */

/* Define to 1 if you have the `__fsetlocking' function. */
/* #undef HAVE___FSETLOCKING */

/* Define as const if the declaration of iconv() needs const. */
/* #undef ICONV_CONST */

/* Define if integer division by zero raises signal SIGFPE. */
#define INTDIV0_RAISES_SIGFPE 1

/* Define to the sub-directory in which libtool stores uninstalled libraries.
   */
#define LT_OBJDIR ".libs/"

/* Name of package */
#define PACKAGE "giac"

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""

/* Define to the full name of this package. */
#define PACKAGE_NAME "giac"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "giac 0.9.4"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "giac"

/* Define to the version of this package. */
#define PACKAGE_VERSION "0.9.4"

/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
/* #undef PRI_MACROS_BROKEN */

/* The size of `int', as computed by sizeof. */
#define SIZEOF_INT 4

/* The size of `long', as computed by sizeof. */
#define SIZEOF_LONG 4

/* The size of `long long', as computed by sizeof. */
#define SIZEOF_LONG_LONG 8

/* Define as the maximum value of type 'size_t', if the system doesn't define
   it. */

/* If using the C implementation of alloca, define if you know the
   direction of stack growth for your system; otherwise it will be
   automatically deduced at runtime.
	STACK_DIRECTION > 0 => grows toward higher addresses
	STACK_DIRECTION < 0 => grows toward lower addresses
	STACK_DIRECTION = 0 => direction of growth unknown */
/* #undef STACK_DIRECTION */

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Define if <tr1/unordered_map> header is available */
#define UNORDERED_MAP 1

/* Replace GMP by tommath */
/* #undef USE_GMP_REPLACEMENTS */

/* Version number of package */
#define VERSION "0.9.4"

/* Define to 1 if the X Window System is missing or not being used. */
/* #undef X_DISPLAY_MISSING */

/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
   `char[]'. */
/* #undef YYTEXT_POINTER */

/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */

/* Define to `__inline__' or `__inline' if that's what the C compiler
   calls it, or to nothing if 'inline' is not supported under any name.  */
#ifndef __cplusplus
/* #undef inline */
#endif

/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */

/* Define as the type of the result of subtracting two pointers, if the system
   doesn't define it. */
// #define ptrdiff_t long

/* Define to empty if the C compiler doesn't support this keyword. */
/* #undef signed */

/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */

/* Define to unsigned long or unsigned long long if <stdint.h> and
   <inttypes.h> don't define. */
/* #undef uintmax_t */

loic
Messages : 168
Inscription : ven. mars 14, 2008 7:20 pm

Re: QtGiac & Windows

Message par loic » mer. juin 13, 2012 12:54 pm

ça se passe néttement mieux, il compile pas mal de choses mai splante tout de même avec ce message:

Code : Tout sélectionner

In file included from ..\qcas\giac\TmpFGLM.C:23:
..\qcas\giac\/first.h:169:17: error: gmp.h: No such file or directory
mingw32-make.exe[1]: *** [debug/TmpFGLM.o] Error 1
Peut-être la libgmp qu'il faut installer sous Win?

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QtGiac & Windows

Message par parisse » mer. juin 13, 2012 3:32 pm

oups, non, il faut commenter toutes les references a GMP et ajouter l'utilisation de USE_GMP_REPLACEMENTS et TOMMATH (cf. le config.h de linux). A voir demain donc!

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QtGiac & Windows

Message par parisse » jeu. juin 14, 2012 8:26 am

bon, j'ai trouve la source du probleme, c'est que le make de qt considere les fichiers .C comme des sources C et pas C++ (probablement a cause de la non-sensitivite a la casse sous windows). Il faut donc rajouter au fichier pro

Code : Tout sélectionner

QMAKE_CFLAGS_DEBUG += -DHAVE_CONFIG_H -DUSE_GMP_REPLACEMENTS -fno-strict-aliasing -Wno-unused-parameter
QMAKE_CFLAGS_RELEASE += -DHAVE_CONFIG_H -DUSE_GMP_REPLACEMENTS -fno-strict-aliasing -Wno-unused-parameter
Il y a une autre erreur ensuite au link, il faut enlever LIBS += dl
Ensuite ca marche pour qtgiac, donc ca devrait etre pareil pour qcas.

loic
Messages : 168
Inscription : ven. mars 14, 2008 7:20 pm

Re: QtGiac & Windows

Message par loic » jeu. juin 14, 2012 9:34 am

Effectivement, Qtgiac compile, mais le pb, c'est que j'utilise la commande make_thread
donc, à chaque fois, dans le config.h je décommente la ligne

Code : Tout sélectionner

/* Define to 1 if you have the `pthread' library (-lpthread). */
#define HAVE_LIBPTHREAD 1 
et qd je lance la compil sous win:
In file included from ..\qcas/giac/giac.h:4,
from ..\qcas\qt\output.cpp:24:
..\qcas/giac/global.h:316: error: 'pthread_t' does not name a type
..\qcas/giac/global.h:317: error: 'pthread_attr_t' does not name a type
..\qcas/giac/global.h:429: warning: ISO C++ forbids declaration of 'pthread_mutex_t' with no type
..\qcas/giac/global.h:429: error: expected ';' before '*' token
..\qcas/giac/global.h:478: error: 'pthread_mutex_t' does not name a type
..\qcas/giac/global.h:762: error: expected constructor, destructor, or type conversion before '*' token
..\qcas/giac/global.h:763: error: 'pthread_mutex_t' does not name a type

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QtGiac & Windows

Message par parisse » jeu. juin 14, 2012 10:55 am

Il faut installer une librairie compatible, peut-etre que http://sourceware.org/pthreads-win32/ convient.

loic
Messages : 168
Inscription : ven. mars 14, 2008 7:20 pm

Re: QtGiac & Windows

Message par loic » jeu. juin 14, 2012 12:58 pm

Ok, merci pour tout!


Je viens de réussir après de multiples essais à inclure la librairie pthread et à compiler le tout sous win!

Je vais essayer de mettre ça au propre pour me souvenir de tout....

parisse
Messages : 5740
Inscription : mar. déc. 20, 2005 4:02 pm
Contact :

Re: QtGiac & Windows

Message par parisse » jeu. juin 14, 2012 1:30 pm

bravo!
j'ai essaye de compiler sans succes cette libpthread avec mingw et j'etais sur le point de conseiller d'abandonner les threads sous windows...

Répondre