HyPhy message board | |
http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl
HYPHY Package >> HyPhy feedback >> compilation http://www.hyphy.org/cgi-bin/hyphy_forums/YaBB.pl?num=1128608247 Message started by konrad on Oct 6th, 2005 at 7:17am |
Title: compilation Post by konrad on Oct 6th, 2005 at 7:17am
Hi, I'm just starting out with this software but see no FAQ, so please excuse the "stupid" question which seems off-topic for the forum - am I the only one for whom compilation didn't work first time?
I'm compiling from source on Linux (Suse professional 9.2; this distribution seems to lack everything that is not completely essential.) I got: main-unix.cxx:41:31: curl/curl.h: No such file or directory I fixed this by adding -D__HYPHY_NO_CURL__ to COMPILER_LINK_FLAGS and COMPILER_FLAGS in build.sh. (What will the effect of NO_CURL be?) I now get: Linking HYPHY /usr/lib/gcc-lib/i586-suse-linux/3.3.4/../../../../i586-suse-linux/bin/ld: cannot find -lssl collect2: ld returned 1 exit status What do I need to do? thanks, Konrad |
Title: Re: compilation Post by konrad on Oct 6th, 2005 at 9:43am
Thanks, it works fine now. I'll look into curl as well.
However, the gtk build gives "pkg-config: command not found". Is this a problem with my gtk installation? |
Title: Re: compilation Post by Sergei on Oct 6th, 2005 at 10:12am
Dear Konrad,
wrote on Oct 6th, 2005 at 9:43am:
Either that, or pkg-config is not in the standard $PATH. If you have any form of GTK (e.g. Gnome) installed on SuSE, then there should be pkg-config somewhere in your system; you may have to fun a 'find' command to see if it's present. Cheers, Sergei |
Title: Re: compilation Post by konrad on Oct 10th, 2005 at 9:54am
Found the problem: I was missing GTK2-devel and some other -devel packages. Everything now builds properly (with CURL), but on running HYPHY_GTK it complains that it cannot find "a required GTKResources directory" and suggests "Please use BASEPATH= command line option...", even though GTKResources is sitting right there in the installation directory I am running from.
Konrad |
Title: Re: compilation Post by Sergei on Oct 10th, 2005 at 10:05am
Dear Konrad,
wrote on Oct 10th, 2005 at 9:54am:
HyPhy uses the getcwd command to identify where it is being launched from. Unless you have cd'ed to the build directory and launched HYPHY_GTK from the command line (which should work), it may not point to the right place. Try running [code] $HYPHY_GTK BASEPATH=/absolute path to hyphy with trailing slash [/code] and see if that helps. Cheers, Sergei |
Title: Re: compilation Post by konrad on Oct 12th, 2005 at 4:35am wrote on Oct 10th, 2005 at 10:05am:
This is what I did. The path quoted back to me in the error message is the correct path. Specifying BASEPATH makes no difference (unsurprising, since it's already correct). |
Title: Re: compilation Post by Sergei on Oct 12th, 2005 at 7:41am
Dear Konrad,
wrote on Oct 12th, 2005 at 4:35am:
This is very odd indeed. HyPhy will report this message if can't find the directory, or if the directory contains no (or only hidden) files. If you do 'ls GTKResources', are you able to see a number of png and xpm files (with numeric names)? Cheers, Sergei |
Title: Re: compilation Post by konrad on Oct 12th, 2005 at 8:08am
Yes, and a subdirectory "theme" with more png files:
~/HyPhy/HYPHY_Source> ls -l GTKResources/ total 271 -rw-r--r-- 1 konrad users 1240 2005-03-25 04:31 130.png -rw-r--r-- 1 konrad users 164 2005-03-07 22:05 131.png -rw-r--r-- 1 konrad users 189 2005-03-07 22:06 132.png etc |
Title: Re: compilation Post by Sergei on Oct 12th, 2005 at 8:15am
Hmm, I am at a loss as to what could be causing this problem, since HyPhy uses standard 'dirent.h' based file system calls to generate a list of files inside a directory.
Does the path to HYPHY source include any nonstandard characters (e.g. spaces etc), or the '~' shorthand for the home directory (which I don't believe is understood by dirent functions)? When the error dialog is displayed, does HyPhy report a complete absolute path to GTKResources? I have not come across this behavior before; may take a few tries to get this sorted out. Cheers, Sergei |
Title: Re: compilation Post by konrad on Oct 12th, 2005 at 8:55am
No nonstandard characters, and yes it reports the full path (no ~).
|
Title: Re: compilation Post by Sergei on Oct 13th, 2005 at 9:23am
Dear Konrad,
wrote on Oct 12th, 2005 at 8:55am:
Would you mind pasting this in place of the same function in HYPlatformUtils.cpp in the GUI directory, recompiling the GTK version, running it from the console and telling me what the code printed (if anything)? Code (] #define KONRAD_DEBUG //__________________________________________________________________________________ char ScanDirectoryForFileNames (_String& source, _List& rec, bool recurse) { DIR * dirPntr = opendir (source.sData); if (dirPntr) /* source directory exists */ { struct dirent * curEntry = nil; while (curEntry = readdir (dirPntr)) // index thru the items { _String childDir (curEntry->d_name); if (childDir[0):
|
Title: Re: compilation Post by konrad on Oct 14th, 2005 at 4:57am
ScanDirectoryForFileNames::checking item 4000.png with d_type of 0
ScanDirectoryForFileNames::checking item 4000.xpm with d_type of 0 ScanDirectoryForFileNames::checking item 4001.png with d_type of 0 etc (d_type = 0 for all 68 items) |
Title: Re: compilation Post by konrad on Oct 14th, 2005 at 5:41am
I added some more printf statements to this function to see what was happening, and bizarrely this caused the program behaviour to change. It now continues running ScanDirectoryForFileNames for the directories UserAddins, TreeAddIns, GeneticCodes and SubstitutionModels (all items have d_type = 0). It then opens the HYPHY Console with text "Loaded 12 genetic code tables from /home/konrad/HyPhy/HYPHY_Source/GeneticCodes" and pops up a warning "The following error occurred: Bad symbols in expression". In my xterm it prints:
** (HYPHY_GTK:7785): WARNING **: Invalid UTF8 string passed to pango_layout_set_text() This warning occurs 3 times when I keep clicking "Skip further messages". It then prints: "I couldn't find any valid model templates in '/home/konrad/HyPhy/HYPHY_Source/SubstitutionModels'. Please check your installation of HYPHY for missing files. Please cite S.L. Kosakovsky Pond, S. D. W. Frost and S.V. Muse. (2005) HyPhy: hypothesis testing using phylogenies. Bioinformatics 21: 676-679 if you use HyPhy in a publication" in the HYPHY Console. After this I am able to operate the menus in the HYPHY Console. On attempting to open the p51.nex example file, the console disappears and the output to the xterm is: ** (HYPHY_GTK:7785): WARNING **: Invalid borders specified for theme pixmap: /home/konrad/HyPhy/HYPHY_Source/GTKResources/theme/entry1.png, borders don't fit within the image (HYPHY_GTK:7785): Gdk-CRITICAL **: file gdkdraw.c: line 265 (gdk_drawable_set_colormap): assertion `cmap == NULL || gdk_drawable_get_depth (drawable) == cmap->visual->depth' failed (HYPHY_GTK:7785): Gdk-CRITICAL **: file gdkdraw.c: line 265 (gdk_drawable_set_colormap): assertion `cmap == NULL || gdk_drawable_get_depth (drawable) == cmap->visual->depth' failed (HYPHY_GTK:7785): Gdk-CRITICAL **: file gdkdraw.c: line 265 (gdk_drawable_set_colormap): assertion `cmap == NULL || gdk_drawable_get_depth (drawable) == cmap->visual->depth' failed (HYPHY_GTK:7785): Gdk-CRITICAL **: file gdkdraw.c: line 265 (gdk_drawable_set_colormap): assertion `cmap == NULL || gdk_drawable_get_depth (drawable) == cmap->visual->depth' failed (HYPHY_GTK:7785): Gdk-CRITICAL **: file gdkdraw.c: line 265 (gdk_drawable_set_colormap): assertion `cmap == NULL || gdk_drawable_get_depth (drawable) == cmap->visual->depth' failed (HYPHY_GTK:7785): Gdk-WARNING **: Using Xft rendering requires the drawable argument to have a specified colormap. All windows have a colormap, however, pixmaps only have colormap by default if they were created with a non-NULL window argument. Otherwise a colormap must be set on them with gdk_drawable_set_colormap Segmentation fault Here is the final part of the function containing all statements I added (the "not a directory item" statement is output every time, the others never): [code] if (curEntry->d_type == DT_DIR) // a directory { #ifdef KONRAD_DEBUG printf ("ScanDirectoryForFileNames::%s detected as directory item.\n", childDir.sData); #endif if (recurse) #ifdef KONRAD_DEBUG printf ("Recursing.\n"); #endif ScanDirectoryForFileNames (childDir,rec,true); } else #ifdef KONRAD_DEBUG printf ("ScanDirectoryForFileNames::%s not a directory item.\n", childDir.sData); #endif if (curEntry->d_type == DT_REG) #ifdef KONRAD_DEBUG printf ("ScanDirectoryForFileNames::%s detected as DT_REG item.\n", childDir.sData); #endif rec && & childDir; } } closedir (dirPntr); } #ifdef KONRAD_DEBUG else printf ("ScanDirectoryForFileNames::Failed to open %s with opendir\n", source.sData); #endif return '/'; } [/code] |
Title: Re: compilation Post by Sergei on Oct 14th, 2005 at 7:42am
Dear Konrad,
Ah finally some light on the problem. readdir is supposed to return different D_TYPEs for different file kinds (e.g. pipers, regular files, directories, and 0 for unknown etc). I took a look at the dirent.h documentation again, and there was a disclaimer that some systems (I thought that meant some OLD systems) would return 0 for all items. This seems to be happening with your SuSE install. I can try to work around that. Regarding other issues: 1). Program behavior changed, b/c the fragment [code] if (curEntry->d_type == DT_REG) #ifdef KONRAD_DEBUG printf ("ScanDirectoryForFileNames::%s detected as DT_REG item.\n", childDir.sData); #endif rec && & childDir; } } [/code] No longer has the rec && & childDir in the if scope (thus items are scanned and added to the list even though d_type is still 0). 2). Pixbuf errors are b/c your screen depth is < 24 bits. I should actually add a check for that - my current (somewhat unfinished) GTK port does not have the extra code needed to handle < 24 bits. 3). I have no idea what the UTF-8 error is all about Cheers, Sergei |
Title: Re: compilation Post by Sergei on Oct 14th, 2005 at 11:04am
Dear Konrad,
Here's a fix of the ScanDirectory... function which does not rely on d_type and uses a more portable stat instead. I'll roll this fix into the next build. Thanks for pointing this out: UNIX portability issues should be dealt with whenever possible! This will teach me a lesson about assuming that if something runs on OS X, RedHat and AIX (three UNIX distros I have access to) then it runs everywhere else :) Code (] //__________________________________________________________________________________ char ScanDirectoryForFileNames (_String& source, _List& rec, bool recurse) { DIR * dirPntr = opendir (source.sData); if (dirPntr) /* source directory exists */ { struct dirent * curEntry = nil; while (curEntry = readdir (dirPntr)) // index thru the items { _String childDir (curEntry->d_name); if (childDir[0):
Cheers, Sergei |
Title: Re: compilation Post by konrad on Oct 17th, 2005 at 3:54am
Great, everything is working now. In case anyone else is following this, you also need to put #include <sys/stat.h>
in the file header. Sorry about the silly mistake with the if scope, but at least it uncovered the color depth issue - setting my color depth to 24 did the trick. Thanks a lot for all the effort, Konrad |
Title: Re: compilation Post by Sergei on Oct 17th, 2005 at 7:41am
Dear Konrad,
I am glad this is working for you now. Please let me know if you have any further issues. Cheers, Sergei |
HyPhy message board » Powered by YaBB 2.5.2! YaBB Forum Software © 2000-2024. All Rights Reserved. |