Welcome

Troves being gleaned while surfing on the Internet mostly about computer/IT/system skills and tricks, Welcome here ...
Powered By Blogger

Disclaimer

This blog is written by the owner with real practices and tests and intended to hold all original posts except there is a clear declaration for referencing from others. Thanks for tagging with the source link or other tips for reference from here if you would like to quote partial or full text from posts in this blog.

Sunday, July 24, 2011

Tracing the segmentation fault problem caused by glutBitmapCharacter or glutBitmapString

When porting an openGL+freeGLUT program to a laptop running with an integrated on-board graphics card ( actually, a part of the chipset, the model is Intel Corporation Mobile 4 Series Chipset Integrated Graphics Controller in HP Presario CQ60 standard configuration ), a call in the code to glutBitmapCharacter always leads the program to perish in the runtime.

Built it in debug mode first and then trace the program with the dumped memory core. It is found that the problem can be traced to glBitmap -> libGL.so.xx -> /usr/lib/dri/i965_dri.so. 

Tried dozens of "solutions" ranging from reinstalling many times of freeglut-2.6 to changing GLUT to the classic GLUT-3.7 following the instruction from http://original.jamesthornton.com/linux/HOWTO/Nvidia-OpenGL-Configuration/instglut.html, including debugging deeply in the code itself, trying different fonts and using glutBitmapString, for instance,  just all end up with failures.

Finally, the installation of GLUT-3.7 through an indirect approach - by installing MesaLib (the another ordeal has been put in http://surfingtroves.blogspot.com/2011/07/defeating-mesalib-installation-issues.html)
give the sense of graphics driver issues. It really is! 

Now, skipping the obscure discussions about the notorious graphics card driver problem in Linux ( this is true at least as far as I am concerned ), just show you the one of real "solutions":

go to /usr/lib/, mv i965_dri.so i965_dri.so.old.

get back the code, I am lucky to get the long gnawing problem solved. You should be as well if your case is similar to mine.

Defeating the MesaLib installation issues - not sufficiently high version of libdrm and then "915_EXEC_BLT" undeclared

While obstructed by the tricky installation of GLUT-3.7 in Linux (Fedora 13/14 in this post's case), an easy expedient is to indirectly install MesaLib since this package should have already included GLUT-3.7 and thus the desirable installation of GLUT-3.7 can be achieved tortuously by installing MesaLib through the source package building.

However, there might be still other problems with the building installation itself of MesaLib, here are several candidates:

1. before generating the makefile, "./configure"  can complains that the version of libdrm_intel is lower than 2.4.21 which is required to compile mesa.

---> download the package of libdrm from http://packages.pardus.org.tr/info/corporate2/devel/source/libdrm.html ,unpack it and go to "./configure", here you may get another obstacle, however, by failure in checking PCIACCESS. fix this easily by "yum -y install libpciaccess" and perhaps also "yum -y install libpciaccess-devel". Then "make" -> "make install". and get back to mesa

Unfortunately, the complaints did not disappear as most likely happens. This is a problem of package recognition previously encountered as the case of "http://surfingtroves.blogspot.com/2010/12/linux-fedora-upgraded-package-and.html" . For this instance, find libdrm_intel.pc ( should be found in /usr/local/lib/pkgconfig/ after installation, if not, copy from the source package of libdrm ( typically in intel/ ) and copy it to a directory like this), then add the containing path to the environment variable PKG_CONFIG_PATH. for example
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH.

Then "pkg-config --modversion libdrm_intel" should confirm that the version is updated to suffice the installation of mesaLib.

2. "./configure" continues to grouches, but with missing of TALLOC this time. Fix it by installing libtalloc and libtalloc-devel using yum like above. and you should be able to get through it.

3. now, do the sure thing "make" , you are probably expected to get stymied again by the complaint like:

"error:  I915_EXEC_BLT undeclared "

The is because the older version of the drm_intel library is still being used. Look at the compilation command line before this complaints, you can find "-I/usr/include/libdrm"  therein.  A simple fix is to copy the command line and manually compile again with "-I/usr/include/libdrm" changed to "-I/usr/local/include/libdrm"  since drm_intel is installed to /usr/local by default.

4. "make install".  And, done.

To check if GLUT-3.7 has been installed during the installation of mesaLib, look at /usr/local/lib/libglut* and /usr/local/include/GL/glut*.

Now you should be alreay there.

Can not hear from earphone on fedora linux ALSA Conexant


1. check if the file /etc/modprobe.d/alsa-base exists, touch an empty one of this if not.


2. add following line to it :
options snd-hda-intel model=olpc-xo-1_5


3.save and reboot.


Then the problem should have gone.


Note that this may only do the tricks for exact this sound device
"Codec: Conexant CX20583 (Pebble HSF)". If it is not working for you, please refer to the original post at http://linux.derkeiler.com/Mailing-Lists/Ubuntu/2010-05/msg00541.html.


 Many thanks to the original author.

Thursday, June 16, 2011

On how universities handle multiple GRE scores (how about taking GRE more than once) ?

RESULTS FROM Google "more than one gre scores"    or " Multiple GRE scores"
(first 50 pages according to the page-rank)



-------------------------------------------------------------------------------------------------------------------------------------------------------------

http://el-prod.baylor.edu/certain_doubts/?p=876
It is getting close to the time for graduating seniors to submit applications to PhD programs, and I’ve been reflecting again on our discipline’s practices in this regard. Especially, I’ve been thinking about the role of GRE scores in the process.
The role of GRE scores in any given graduate program is fairly obscure, but it is fair to say that there are institutional pressures to recruit students with higher GRE scores. There are various ways to succumb to these pressures, from a crass preference for higher GRE scores to a system in which first cuts are made on the basis of GRE scores. I don’t mean to attach any significance to the question of whether such practices amount to succumbing to pressure, however; my concern is with the practices themselves ...........................

-------------------------------------------------------------------------------------------------------------------------------------------------------------
http://www.vetmed.wsu.edu/prospectivestudents/admissionProcedure.aspx

* GRE percentile is calculated by averaging the percentile rank from the three sections of the general test (composite score). If an application contains more than one set of GRE scores, the committee will consider the highest section score. Only GRE scores received by the admissions office at the time of initial academic evaluation will contribute to Tier assignment.

-------------------------------------------------------------------------------------------------------------------------------------------------------------
http://chhs.gsu.edu/pt/faq.asp 
15.    I've taken the GRE multiple times.  Which scores will you use?
We will use the highest score earned in each section of the GRE. For example, if your verbal test score was high the first time, we will use that score rather than your most recent verbal score (if lower). A minimum verbal score of 400 must be obtained. The required Analytical Writing Section score is 3.5. Scores cannot be more than five years old from the desired semester of entry. 


-------------------------------------------------------------------------------------------------------------------------------------------------------------
http://www.yale.edu/graduateschool/admissions/faqstq.html
 GRE scores are but one of many criteria used to evaluate an applicant. Individual departments practices may differ, but overall the best score from each section is used. However, you must submit ALL of your GRE scores in order to have the department consider the highest from each section.

-------------------------------------------------------------------------------------------------------------------------------------------------------------
http://www.physics.ucsb.edu/education/graduate/prospective/faqsforapps.htm#mixgre

I have taken the GRE exams more than once. Can I mix and match the results?

GRE scores can not be mixed and matched. We will review only the most recent scores, regardless of the outcome.
-------------------------------------------------------------------------------------------------------------------------------------------------------------

Friday, May 27, 2011

building installation of freeglut ------ problem with /usr/lib/libGL.so.1 or /lib/libm.so.6

When setting up freeglut with the source code package downloaded from sourceForge in the Fedora Linux environment, there always complains in the link step about loss of either of following two dynamically-linked libraries on the linker's command line:

/usr/lib/libGL.so.1
/lib/libm.so.6

The typical prompt would be like the lines as follows:

freeglut is defined in DSO /usr/lib/libGL.so.1 so try adding it to the linker command line

A very gauche approach is to edit each Makefile spread over different levels of directories in the source code root, by changing each "CC=gcc" line to "CC=gcc /usr/lib/libGL.so.1 /lib/libm.so.6". Obviously, you will need much pissy manual work to treat this nasty problem.

Here what I would like to share is a cheaper yet perky way, maybe not that paradigmatic though, to the quick solution:

1. enter /usr/bin/  (or somewhere else gcc lies, the location can be retrieved by whereis gcc );
2. mv gcc gcc_org 
3. touch gcc and add following lines in it:
#!/bin/bash

/usr/bin/gcc_org $@ /usr/lib/libGL.so.1 /lib/libm.so.6


4. chmod +x gcc

Now get back to glut source package directory and follow the original instruction, that is, "./configure" -> "make && make install".

You should not expect further problems until everything will be set up well there.

After done, do not forget to clean up the your cheating spot : move to /usr/bin,
and "mv gcc_org gcc".

Monday, March 28, 2011

A TUI library for Dos/Windows

A Text User Interface Library in C++ for DOS/Windows. Useful for building light-weighted TUI based applications.

http://sourceforge.net/u/haipengcai/wikituidos/Home/

Tuesday, February 8, 2011

Why vim not search STL headers?

In vim it is common to open a header in place, which is really a handy feature for browsing a directory hierarchy.

But you might find this functionality seems to fail with C++ STL headers : when the cursor is blinking under "#include <iostream>", say, and your hitting 'gf' will not respond by entering that header but engender a grouch like following instead:

"E447: Can't find file iostream in path".

In actuality it is quite easy to resolve this problem by riffling through vim manual.

Treatment:

open the rc file of vim, for instance, /etc/vimrc, add following setting :

set path = **,/usr/include/c++/**

provided your c++ STL headers are hoarded in /usr/include/c++.

reopen the source code you were previously browsing around and try "gf" again, it should work now! It is really that piece of cake!  Really extensible is vim!

remove empty line by sed or in vim

In vim, following the same trick for general sustitution:
:%s/^[\ \t]*\n//g 

By sed on the command line:
cat orgfile | sed /^$/d

Saturday, January 8, 2011

Enable X Shared Memory Extension Pixmaps

Definitely not encouraged to use, sometimes this feature is needed for using certain applications what depends on this deprecated X window extension.

Found the solution on http://fxc.noaa.gov/FSD-NVIDIA-OB9-FXC.htm. More precisely, an example illustrating the details with Nvidia series on Fedora 14 is shown as follows.

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 260.19.29 
# (buildmeister@swio-display-x86-rhel47-04.nvidia.com)  Wed Dec 
# 8 12:27:39 PST 2010


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
    FontPath        "/usr/share/fonts/default/Type1"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/input/mice"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from data in "/etc/sysconfig/keyboard"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout" "us"
    Option         "XkbModel" "pc105"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    HorizSync       28.0 - 33.0
    VertRefresh     43.0 - 72.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    Option    "AllowSHMPixmaps" "true"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection

The enabling appendix is simply the single line below.
Option "AllowSHMPixmaps" "true"

Then reboot the system to make it effect.

Following code snippet could be used for verifying the availability of this feature:

int vmajor;

int vminor;
bool vpixmap;
bool shm_flag;
if (XShmQueryVersion(window->getDisplay(),&vmajor,&vminor,&vpixmap) != True) { 
    cerr << "X Shared Memory Extension not supported." << endl;
    shm_flag=false;
}
else if (vpixmap != True) { 
    cerr << "X Shared Memory Extension Pixmap not supported." << endl;
    shm_flag=false;
}
else {
    // do what is relying on the MIT-SHM feature from here on
    ......
}