Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

Tools & Utilities
Enthusiast

Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

I am trying to update both the compiler and linker paths used by Teradata to locate the current C/C++ compiler.

From reading other posts I have determined that this is possible using the cufconfig utility from either the command line or database window, and from reading the Utilities Reference manual (and the help command from CMD - which is actually better than the manual!) I have found that the option I need to use is:

cufconfig -f filename

I have tried various ways of defining the input file used to specify the updates (see below) but I am unable to use the utility to update the settings (for information I am unable to find any examples of this utilities usage).

Example cufconfig.txt file I have written:

CompilerPath "D:\Program Files\Microsoft Visual Studio 8\VC\bin\"
LinkerPath "D:\Program Files\Microsoft Visual Studio 8\VC\bin\"

(I have also tried without quotes and using equals symbols, etc!).

Any advice would be greatly appreciated.

Rob
15 REPLIES
Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED


I think you need to include the executable names as well ...

try something like this .....

CompilerPath: D:\Program Files\Microsoft Visual Studio 8\VC\bin\CL.EXE
LinkerPath: D:\Program Files\Microsoft Visual Studio 8\VC\bin\LINK.EXE
Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

joedsilva - Thanks for that information it worked like a treat.

Unfortunately it didn't solve all my issues (I was trying to get stored procedures to work with the TD 6.1 Demo), although it certainly helped.

I then managed to findout some additional registry key info and now it is all working well.

For peoples help I have posted the new registry info below:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1]
"Source Directories"=";;"
"CLR Version"="v1.1.4322"
"InstallDir"="D:\Program Files\Microsoft Visual Studio 8\Common7\IDE"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\CLSID]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\CLSID\{4D4D35A3-1391-4E17-813D-54D1B846096A}]
"ThreadingModel"="Both"
"InprocServer32"="D:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger\jsee.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Path]
"MSO"="D:\Program Files\Common Files\Microsoft Shared\Office11\MSO.DLL"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Registration]
"UserName"="root"
"ProductID"=""
"PIDKEY"=""

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Setup]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Setup\Microsoft .NET Framework SDK (English) 1.1]
"InstallSuccess"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Setup\VC]
"ProductDir"="D:\Program Files\Microsoft Visual Studio 8\VC\"
"VC7CommonDir"="D:\Program Files\Microsoft Visual Studio 8\Common7\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Setup\VS]
"VS7CommonBinDir"=""
"VS7CommonDir"="D:\Program Files\Microsoft Visual Studio 8\Common7\"
"ProductDir"="D:\Program Files\Microsoft Visual Studio 8\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS]

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\FRAMEWORKSDK]
"7.1"="D:\Program Files\Microsoft.NET\SDK\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\SxS\VC7]
"7.1"="D:\Program Files\Microsoft Visual Studio 8\Vc7\"

Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

Oops I thought you had that info already

I am not sure if all those registry entries are required ...

in our Demo systems [on Win XP], we normally use only these two ... and we have everything from SPs, UDFs and External SPs running fine ...

contents of the .reg file .... (this is for folks using .NET v1.1)

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1]
"InstallDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\7.1\Setup\VC]
"ProductDir"="C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\"

And then copy

C:\Program Files\Microsoft.NET\SDK\v1.1\Bin\nmake.exe
to
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\nmake.exe

Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

Hi Joe,

Thanks for your help with this! Using these registry settings, the 'cufconfig' settings above, and by adding the path to NMAKE to my system's default path, I was able to start compiling UDFs using Visual Studio 2005 (VC8).

One more question: When I compile UDFs, I can execute them in unprotected mode, but I can't execute them in protected mode. [I get an error from BTEQ and a message in Event Log - I'll find it and edit it in here].

I had to create a 'tdatuser' user (with no password) and a 'tdatudf' group manually. Do you know if there are any settings surrounding this user/group that you guys had to set manually? Whether they have a special password, or any special Local Security Policy settings?

I also tried messing around with CREATE AUTHORIZATION, but I was not successful ...

PS: A note for others - using the VC8 compiler, I need to manually add 'libcmt.lib' or 'msvcrt.lib' to the list of libraries to be linked in with each UDF if that UDF makes standard C library function calls. I did this using the 'SL' EXTERNAL NAME option: 'SL!msvcrt!...'
Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

Chris, AFAIK, the tdatuser and the corresponding group should have got created when you installed the database itself. This is something that's done by the database setup program. And the user and group are created irrespective of whether you have a compiler installed or not.

Do you recall any error messages from the setup process ?

And to the best of my knowledge you can't create that user manually and link it to the database authorization. (may be the support guys knows some trick ...)

CREATE AUTHORIZATION statements are useful only when you want the UDF to be executed as a particular user process and not the default user (which is tdatuser). But it doesn't aid in creating the default user itself.

But you did a good hacker's job ;-)

To quote the error messages description.

( which you would get if you just disable the account where it has been created by TD ;-) and tried to execute a protected UDF )
7566 The protected mode user is not defined;
cannot execute UDF/XSP/UDM.
For Whom: Site support representative
Note: The Database installation procedure is supposed
to create the user ’tdatuser’ group ’tdatudf’ on all nodes
on the Teradata system. The user is used to execute protected
mode UDFs/XSPs/UDMs.

I would presume that due to some weird reasons (but you were able to create it manually so I can't imagine a good reason). The setup process could not create the default user ....
Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

Thanks for all of your help on this topic, Joe - I appreciate you taking the time. I'm going to try to reinstall the database, see what happens ...
rgs
Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

Make sure before you reinstall it to delete “tdatuser” and the group “tdatudf” before you reinstall. If it sees a “tdatuser” on the system already it will not install it again. It can’t have a blank password. It has a specific one and only the installation process can set that up. If it does install it do not play with any of the settings or it will probably stop working.
Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

Thank you for the advice, rgs. I did remove both the 'tdatuser' I created and the 'tdatudf' group, and both were created by the installer when I reinstalled the database. I don't know what happened the first time! I'll come back and post all of my settings for anyone else interested ... Thanks to all!
Enthusiast

Re: Updating Teradata Compiler and Linker Paths (cufconfig -f ) - HELP REQUIRED

And yeah it's always useful to back up those Amp*disk* files in tdconfig directory before the reinstall, just replacing those DB files after the install, get's you back on to your old database. (provided the original cause for re-install is not a bad AMP file system)

Of course you need to recompile the UDFs because they are kept as external libraries.

ALTER FUNCTION udfname RECOMPILE;
ALTER FUNCTION udfname EXECUTE NOT PROTECTED; -- recompile makes udfs protected automatically.