Intel Fortran Compiler + MK Library Installation Problem





Hello,


 


we tried to install the MK library on our Centos 6 computing cluster. We're useing the Intel-Fortran-Compiler (parallel\_studio\_xe\_2016.5.074). After the installation we received the following error while compiling via mpif90:


[Spoiler](#) (Highlight to read)libdmumps.a(dscalapack.o): In function `pfpotrf\_':  
dscalapack.F:(.text+0x105): undefined reference to `pdpotrf\_'  
libdmumps.a(dscalapack.o): In function `pfpotrs\_':  
dscalapack.F:(.text+0x347): undefined reference to `pdpotrs\_'  
libdmumps.a(dscalapack.o): In function `pfgetrf\_':  
dscalapack.F:(.text+0x5ba): undefined reference to `pdgetrf\_'  
libdmumps.a(dscalapack.o): In function `pfgetrs\_':  
dscalapack.F:(.text+0xaf6): undefined reference to `pdgetrs\_'  
libmumps\_common.a(xscalapack.o): In function `numroq\_':  
xscalapack.F:(.text+0x3e): undefined reference to `numroc\_'  
libmumps\_common.a(xscalapack.o): In function `lstc\_gridinfo\_':  
xscalapack.F:(.text+0x99): undefined reference to `blacs\_gridinfo\_'  
libmumps\_common.a(xscalapack.o): In function `pkerbla\_':  
xscalapack.F:(.text+0xf4): undefined reference to `pxerbla\_'  
libmumps\_common.a(xscalapack.o): In function `lstc\_gridinit\_':  
xscalapack.F:(.text+0x134): undefined reference to `blacs\_gridinit\_'  
libmumps\_common.a(xscalapack.o): In function `lstc\_gridexit\_':  
xscalapack.F:(.text+0x165): undefined reference to `blacs\_gridexit\_'  
libmumps\_common.a(xscalapack.o): In function `desqinit\_':  
xscalapack.F:(.text+0x1fb): undefined reference to `descinit\_'libdmumps.a(dscalapack.o): In function `pfpotrf\_':dscalapack.F:(.text+0x105): undefined reference to `pdpotrf\_'libdmumps.a(dscalapack.o): In function `pfpotrs\_':dscalapack.F:(.text+0x347): undefined reference to `pdpotrs\_'libdmumps.a(dscalapack.o): In function `pfgetrf\_':dscalapack.F:(.text+0x5ba): undefined reference to `pdgetrf\_'libdmumps.a(dscalapack.o): In function `pfgetrs\_':dscalapack.F:(.text+0xaf6): undefined reference to `pdgetrs\_'libmumps\_common.a(xscalapack.o): In function `numroq\_':xscalapack.F:(.text+0x3e): undefined reference to `numroc\_'libmumps\_common.a(xscalapack.o): In function `lstc\_gridinfo\_':xscalapack.F:(.text+0x99): undefined reference to `blacs\_gridinfo\_'libmumps\_common.a(xscalapack.o): In function `pkerbla\_':xscalapack.F:(.text+0xf4): undefined reference to `pxerbla\_'libmumps\_common.a(xscalapack.o): In function `lstc\_gridinit\_':xscalapack.F:(.text+0x134): undefined reference to `blacs\_gridinit\_'libmumps\_common.a(xscalapack.o): In function `lstc\_gridexit\_':xscalapack.F:(.text+0x165): undefined reference to `blacs\_gridexit\_'libmumps\_common.a(xscalapack.o): In function `desqinit\_':xscalapack.F:(.text+0x1fb): undefined reference to `descinit\_'
Unfortunately, i'm not able to solve this issue by my own and would be grateful for any provided help.
I think that the Parallel Studio installer contains Scalapack as a selectable component, and Scalapack is installed if the "cluster option" is selected during installation. 


It is also possible that your system has a version of Scalapack that was obtained from a Linux distro/repository, so the details vary. 


Please consult your system administrator (even if that is yourself!) regarding what components are installed on your system.




[View solution in original post](/t5/Intel-oneAPI-Math-Kernel-Library/Intel-Fortran-Compiler-MK-Library-Installation-Problem/m-p/1207327#M30013)
A couple of notes to get started:



> 
> .apply(literal\_eval)
> 
> 
> 


Wouldn't this be better as `map`?



> 
> I then re-create the Dask DF:
> 
> 
> ddf = dd.from\_pandas(ddf\_out, npartitions=nCores)
> 
> 
> 


`ddf_out` was already a dask dataframe, I don't know why you had to do this.



> 
> The columns in result seem to match those in metadir.
> 
> 
> 


The value of `result.columns` is taken from the meta you provided, no computing happens until you ask for it (dask is lazy in most operations). Does the ValueError exception not provide further information?


Here is a full example



```
x = ({'F9_07_PZ_COMP_DIRECT': '0',
  'F9_07_PZ_DIRTRSTKEY_NAME': 'DEBRA MEALY',
  'F9_07_PZ_COMP_OTHER': '0',
  'F9_07_PZ_COMP_RELATED': '0',
  'F9_07_PZ_TITLE': 'CHAIR PERSON',
  'F9_07_PZ_AVE_HOURS_WEEK': '1.00',
  'F9_07_PC_TRUSTEE_INDIVIDUAL': 'X'},
 {'F9_07_PZ_COMP_DIRECT': '0',
  'F9_07_PZ_DIRTRSTKEY_NAME': 'HELEN GORDON',
  'F9_07_PZ_COMP_OTHER': '0',
  'F9_07_PZ_COMP_RELATED': '0',
  'F9_07_PZ_TITLE': 'VICE CHAIR',
  'F9_07_PZ_AVE_HOURS_WEEK': '1.00',
  'F9_07_PC_TRUSTEE_INDIVIDUAL': 'X'})
df = pd.DataFrame({'a': x})
d = dd.from_pandas(df, 1)
meta = pd.DataFrame(columns=['F9_07_PZ_COMP_DIRECT', 
       'F9_07_PZ_DIRTRSTKEY_NAME',
       'F9_07_PZ_COMP_OTHER', 'F9_07_PZ_COMP_RELATED', 'F9_07_PZ_TITLE',
       'F9_07_PZ_AVE_HOURS_WEEK', 'F9_07_PC_TRUSTEE_INDIVIDUAL'], dtype="O")
d.map_partitions(lambda df: df.a.apply(pd.Series), meta=meta).compute()

```

How did I know what `meta` to use? I applied the function to the pandas dataframe - you might use a small piece of the dataframe to do this.


Some additional notes:


* it is an anti-pattern to load the data with pandas, pass to dask workers and then gather the whole result back to a pandas (in memory) dataframe, you are very unlikely to see a speedup this way and may incur a lot of overhead. You are better off loading with something like `dd.read_csv`, and aggregating or writing with dask functions too. Only `compute()` on something that will be small or not return anything (because it involves writing the output). The official examples do not use from\_pandas.
* string and dict processing are python methods, and so hold the interpreter lock (GIL) of any python function: threads will not actually run in parallel. To get parallelism, you need to run in processes, which is most easily achieved using <https://docs.dask.org/en/latest/setup/single-distributed.html>
* the distributed scheduler also gives you access to the dashboard, which has a lot of useful information to diagnose how your system is running. You can also configure a lot about its behaviour, in case you have firewall rules you need to obey. This error has to do with the XFree86 config file. I'm not sure about Mandrake, but in Windows it's at /etc/X11/XF86Config or /etc/X11/XF86Config-4



This file can be hand-edited or configured via a program such as Xconfigurator or xf86config (I think those are the names of the programs? if you have them installed)



What video card are you using? If you're using an Nvidia based card, go to the Linux section of [nvidia.com](http://nvidia.com/) and there is a detailed text file with everything you need to know about this file to get it to work. I have the same problem and added this to the DbContext:



```
private void PrintStackTrace()
{
  var st = new StackTrace();
  foreach (var sf in st.GetFrames())
    Console.WriteLine($"{sf.GetMethod().DeclaringType.Assembly.GetName().Name} {sf.GetMethod().DeclaringType.Name} {sf.GetMethod().Name}");
}

```

and call this function in the contructor and Dispose of the DbContext.


It seems to be a problem, if the DbContext is added with scoped lifetime to the dependency injection. I filed an issue for that.


<https://github.com/aspnet/EntityFrameworkCore/issues/10693> hey,

you can probably fix it by following the steps described here: <https://folivora.ai/blog/post/13010>

if that doesn't help, could you check whether there are any crashlogs in the macos console app under "user reports"? thanks for your comment!

i definitely should’ve used mkshell, not sure why i wasn’t. it does seem to produce a different error:

make: entering directory '/build/source/doc/manual'

xsltproc --nonet --param section.autolabel 1 --param section.label.includes.component.label 1 --param html.stylesheet … need to add 



```
services.AddEntityFrameworkSqlite().AddDbContext<ApplicationDbContext>();

```

and delete



```
services.AddIdentity<IdentityUser, IdentityRole>()
                    .AddEntityFrameworkStores<ProductContext>();

```

in startup.
the error was about bad startup configuration.
Was sending too much things.


ApplicationDbContext:



```
 public class ApplicationDbContext : IdentityDbContext
    {
        public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
            : base(options)
        {
        }
        public Microsoft.EntityFrameworkCore.DbSet<Product> Products { get; set; }
        public Microsoft.EntityFrameworkCore.DbSet<List> Lists { get; set; }

        public Microsoft.EntityFrameworkCore.DbSet<ProductList> ProductLists { get; set; }


        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            base.OnConfiguring(optionsBuilder);

             optionsBuilder.UseSqlite("Data Source=assistant.db");

        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {

            base.OnModelCreating(modelBuilder);
            modelBuilder.Entity<ProductList>()
                .HasKey(pl => new { pl.ProductId, pl.ListId });

            modelBuilder.Entity<ProductList>()
                .HasOne(pl => pl.Product)
                .WithMany(p => p.ProductList)
                .HasForeignKey(pl => pl.ProductId)
                .OnDelete(DeleteBehavior.Cascade);

            modelBuilder.Entity<ProductList>()
                .HasOne(pl => pl.List)
                .WithMany(l => l.ProductList)
                .HasForeignKey(pl => pl.ListId)
                .OnDelete(DeleteBehavior.Cascade);
        }
    }

``` hi andrew penny, - - just add this namespace definition: - xmlns:system=clr-namespace:system;assembly=mscorlib - - there are differences in parsing between wpf and silverlight and that is the reason we used the syntax below. if you develop silverlight application you can set it as follows: - - discreteobjectkeyframe keytime=0.00:00:00.0 value=2 /> - - - best wishes, - sia - the telerik team - - - do you want to have your say when we set our development plans? - do you want to know when a feature you care about is added or when a bug fixed? - explore the - telerik public issue tracking - system and vote to affect the priority of the items - - [image] syclik:

install.packages(“rcpp”, type = “source”)

i’ve just tickled this bug myself on a fresh install of rstudio with rstan 2.16.2 (latest).

installing rcpp wasn’t enough in my case - (working on a mac), in addition i had to do:

install.packages("rstan", type ="source")

library(rs… > 
> My question is when does this function works improperly and why?
> 
> 
> 


Technically it works improperly when you call it with an input stream or an update stream in input mode. That is, if you use fopen() with a "w" mode, or a "+" mode and you're currently in the process of reading from the stream, or stdin.


In practice, all of the above situations are okie dokie *iff* the compiler supports them (and some do, including Borland and Microsoft compilers). In terms of best practice, fflush() on an input stream is frowned upon.


However, note that calling fflush() on an output stream is both well defined and recommended for things such as forcing a user prompt to display, well...promptly. :)



> 
> Nowadays I use scanf("[^\n]") to flush input stream. Is this ok?
> 
> 
> 


Close. The correct call for scanf() to read up to a newline would be:



```
scanf("%*[^\n]");

```

This isn't complete though, because the newline will still be in the stream. You still need to extract it. One way would be to add an ignored character match in the format string:



```
scanf("%*[^\n]%*c");

```

This might not be as flexible though, if you want to do other stuff like count discarded characters. Another way would be to call getchar() after scanf():



```
scanf("%*[^\n]");
getchar();

```

Finally, there's the far more common (and faster!) method of calling getchar() in a loop. I'll even give you a function that you can call instead of having to write it ad hoc every time:



```
#include <stdio.h>

void clear_line(FILE *in)
{
    int ch;

    /* Do nothing if the stream is in an error state */
    if (ferror(in))
        return;

    /* Make sure any end-of-file  state is cleared */
    clearerr(in);

    /* Extract and discard up to a newline or end-of-file */
    do
        ch = getc(in);
    while (ch != '\n' && ch != EOF);

    /*
        Clear an end-of-file state if we stoped on EOF,
        but leave any legitimate error state for the caller
    */
    if (!ferror(in))
        clearerr(in);
}

```

Note that even this solution is incomplete when compared with what people expect from `fflush(stdin)` because it blocks for input when the stream is empty. fflush(), when flushing input streams is supported, will return without blocking on an empty stream. Unfortunately, there's no portable way to emulate that behavior, but it's fairly simple to just ensure that the stream is never empty when calling clear\_line().



> 
> fflush( std::cout );
> 
> 
> 


Yeah, that won't work. fflush() expects a pointer to FILE, not an std::ostream object. std::ostream has its own flush() member for synchronizing with the destination device.


It's also quite silly to flush cout explicitly prior to accepting input through cin because the two are tied together. As soon as you request input from cin, the tied stream (cout) is automatically flushed. Doing it yourself explicitly isn't harmful, but it *is* redundant.


It's actually a pretty nifty feature of the iostream library. Read more about it starting [here](http://www.cplusplus.com/reference/iostream/ios/tie/). use modbus read instead of modbus server