Welcome, Guest. Please Login
YaBB - Yet another Bulletin Board
 
  HomeHelpSearchLogin  
 
Pages: 1 2 
compilation (Read 10128 times)
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
compilation
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
Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: compilation
Reply #1 - Oct 6th, 2005 at 8:51am
 
Dear Konrad,

libcurl (and libssl) are not essential for HyPhy - they simply enable the GetURL command, which is not used for most analyses. Setting the D__HYPHY_NO_CURL__ will toggle code #ifdefs to exclude curl specific code, but my trivial build script will still try to link the libraries. Scan the build.sh (or gtk_build.sh) file for LINKER_FLAGS and remove references to lcurl, lssl and lcrypto.

On the other hand, curl is a handly thing to have; it compiles out of the box (including SuSE systems) and can be downloaded from Multimedia File Viewing and Clickable Links are available for Registered Members only!!  You need to Login Login

HTH,
Sergei
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Re: compilation
Reply #2 - 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?
Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: compilation
Reply #3 - Oct 6th, 2005 at 10:12am
 
Dear Konrad,

Quote:
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?


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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Re: compilation
Reply #4 - 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
Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: compilation
Reply #5 - Oct 10th, 2005 at 10:05am
 
Dear Konrad,

[quote author=konrad  link=1128608247/0#4 date=1128963279]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.
[/quote]

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


Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Re: compilation
Reply #6 - Oct 12th, 2005 at 4:35am
 
[quote author=Sergei  link=1128608247/0#5 date=1128963902]
Unless you have cd'ed to the build directory and launched HYPHY_GTK from the command line (which should work)...
[/quote]

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).

Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: compilation
Reply #7 - Oct 12th, 2005 at 7:41am
 
Dear Konrad,

[quote author=konrad  link=1128608247/0#6 date=1129116952]

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).

[/quote]

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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Re: compilation
Reply #8 - 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
Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: compilation
Reply #9 - 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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Re: compilation
Reply #10 - Oct 12th, 2005 at 8:55am
 
No nonstandard characters, and yes it reports the full path (no ~).
Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: compilation
Reply #11 - Oct 13th, 2005 at 9:23am
 
Dear Konrad,

[quote author=konrad  link=1128608247/0#10 date=1129132543]No nonstandard characters, and yes it reports the full path (no ~).
[/quote]

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] != '.') // invisible file
                 {
                       #ifdef KONRAD_DEBUG
                             printf ("ScanDirectoryForFileNames::checking item %s with d_type of %x\n", childDir.sData, curEntry->d_type);
                       #endif
                       childDir = source & '/' & childDir;                  
                       if (curEntry->d_type == DT_DIR)
                       // a directory
                       {
                             if (recurse)
                                   ScanDirectoryForFileNames (childDir,rec,true);
                       }
                       else
                             if (curEntry->d_type == DT_REG)
                                   rec && & childDir;
                 }
           }
           closedir (dirPntr);
     }
     #ifdef KONRAD_DEBUG
     else
           printf ("ScanDirectoryForFileNames::Failed to open %s with opendir\n", source.sData);
     #endif
     return '/';
}
[/code]
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Re: compilation
Reply #12 - 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)
Back to top
 
WWW WWW  
IP Logged
 
konrad
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 53
Re: compilation
Reply #13 - 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]
Back to top
 
WWW WWW  
IP Logged
 
Sergei
YaBB Administrator
*****
Offline


Datamonkeys are forever...

Posts: 1658
UCSD
Gender: male
Re: compilation
Reply #14 - Oct 14th, 2005 at 7:42am
 
Dear Konrad,

Ah finally some light on the problem. [tt]readdir[/tt] 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 [tt]rec && & childDir[/tt] 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
Back to top
 

Associate Professor
Division of Infectious Diseases
Division of Biomedical Informatics
School of Medicine
University of California San Diego
WWW WWW  
IP Logged
 
Pages: 1 2